From 84ac565fa8653d3b3ab62a52e6c58277f5cfbb6d Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Tue, 28 May 2024 17:36:07 -0700 Subject: [PATCH] Fix "findNodeHandle inside its render()" False Positive Warning --- packages/react-native-renderer/src/ReactNativePublicCompat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-renderer/src/ReactNativePublicCompat.js b/packages/react-native-renderer/src/ReactNativePublicCompat.js index 7d6bb49741648..c50b881c150c1 100644 --- a/packages/react-native-renderer/src/ReactNativePublicCompat.js +++ b/packages/react-native-renderer/src/ReactNativePublicCompat.js @@ -90,7 +90,7 @@ export function findHostInstance_DEPRECATED( export function findNodeHandle(componentOrHandle: any): ?number { if (__DEV__) { const owner = currentOwner; - if (owner !== null && owner.stateNode !== null) { + if (owner !== null && isRendering && owner.stateNode !== null) { if (!owner.stateNode._warnedAboutRefsInRender) { console.error( '%s is accessing findNodeHandle inside its render(). ' +