react-native-svg icon indicating copy to clipboard operation
react-native-svg copied to clipboard

`findNodeHandle` is deprecated in React StrictMode

Open gionathas opened this issue 11 months ago • 3 comments

Description

When wrapping a React Native app with React.StrictMode, using a Svg component from react-native-svg triggers console warnings/errors due to the use of the deprecated findNodeHandle function.

Expected Behavior

The app should run without any warnings or errors when using React.StrictMode. react-native-svg should use an alternative approach that avoids findNodeHandle (e.g. by using refs)

Actual Behavior

Console logs show warnings/errors related to findNodeHandle being deprecated. This might lead to potential issues in future versions of React Native as the function could be removed entirely.

Steps to reproduce

  1. Wrap a React Native app with React.StrictMode.
  2. Render a Svg or Shape component from react-native-svg anywhere in the app.
  3. Observe the console warnings/errors related to findNodeHandle being deprecated.

Snack or a link to a repository

The reproduction repository is private.

SVG version

15.11.1

React Native version

0.73.6

Platforms

iOS, Android

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Paper (Old Architecture)

Build type

Debug app & dev bundle

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

gionathas avatar Jan 31 '25 10:01 gionathas

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

github-actions[bot] avatar Jan 31 '25 10:01 github-actions[bot]

+1

I have a react native (expo) project for web. When I upgrade expo version to 53 it is broken becouse of this: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/exports/findNodeHandle/index.js

The findNodeHandle is deprecated on web and this package is use it: https://github.com/search?q=repo%3Asoftware-mansion%2Freact-native-svg%20findNodeHandle&type=code

dembal1990 avatar May 12 '25 12:05 dembal1990

Hey, could you provide a proper reproduction of the issue, ideally using snack? The use of findNodeHandle is limited to mobile platforms, so none of the code linked by @dembal1990 should be running on the web.

jakex7 avatar May 12 '25 14:05 jakex7