mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix "findNodeHandle inside its render()" False Positive Warning (#29627)
This was missed in https://github.com/facebook/react/pull/29038 when unifying the "owner" abstractions, causing `findNodeHandle` to warn even outside of `render()` invocations. DiffTrain build for commit https://github.com/facebook/react/commit/3b29ed16386c1afb2e76c3db0d576184154ec141.
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
||||
163122766b6008e992898b00f1fe3b104ed78737
|
||||
3b29ed16386c1afb2e76c3db0d576184154ec141
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<e788833561fd15923c3878d11f308805>>
|
||||
* @generated SignedSource<<10cfb47da57f40f3c6d1aaf8620d48a4>>
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@@ -26212,7 +26212,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = '19.0.0-rc-e4976d97';
|
||||
var ReactVersion = '19.0.0-rc-76d74f41';
|
||||
|
||||
/*
|
||||
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
|
||||
@@ -26799,7 +26799,7 @@ function findNodeHandle(componentOrHandle) {
|
||||
{
|
||||
var owner = current;
|
||||
|
||||
if (owner !== null && owner.stateNode !== null) {
|
||||
if (owner !== null && isRendering && owner.stateNode !== null) {
|
||||
if (!owner.stateNode._warnedAboutRefsInRender) {
|
||||
error('%s is accessing findNodeHandle inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentNameFromType(owner.type) || 'A component');
|
||||
}
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<40a0e1ce33bc52f3d6d9fc7ae12f7651>>
|
||||
* @generated SignedSource<<0d778c4f67b7a3562c3dae6ebc4f0c47>>
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@@ -26562,7 +26562,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = '19.0.0-rc-a40621a5';
|
||||
var ReactVersion = '19.0.0-rc-068dfbff';
|
||||
|
||||
/*
|
||||
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
|
||||
@@ -27143,7 +27143,7 @@ function findNodeHandle(componentOrHandle) {
|
||||
{
|
||||
var owner = current;
|
||||
|
||||
if (owner !== null && owner.stateNode !== null) {
|
||||
if (owner !== null && isRendering && owner.stateNode !== null) {
|
||||
if (!owner.stateNode._warnedAboutRefsInRender) {
|
||||
error('%s is accessing findNodeHandle inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentNameFromType(owner.type) || 'A component');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user