software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
9.04k stars 1.31k forks source link

web: AnimatedComponent raises a deprecation warning for findDOMNode in v3.12.0 #6072

Closed MaxGraey closed 5 months ago

MaxGraey commented 5 months ago

Description

With latest update, Expo project for web builds start to show error:

Warning: findDOMNode is deprecated and will be removed in the next major release. 
Instead, add a ref directly to the element you want to reference. 
Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node
    at AnimatedComponent
    ...

Steps to reproduce

start expo for web (or eact-native + react-native-for-web) with dev mode enabled.

Snack or a link to a repository

-

Reanimated version

3.12.0

React Native version

0.74

Platforms

Web

JavaScript runtime

V8

Workflow

Expo Dev Client

Architecture

Fabric (New Architecture)

Build type

Debug app & dev bundle

Device

None

Device model

No response

Acknowledgements

Yes

github-actions[bot] commented 5 months ago

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Snack or a link to a repository section.

github-actions[bot] commented 5 months ago

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?

MaxGraey commented 5 months ago

It looks like this was introduced in #5960 here: https://github.com/software-mansion/react-native-reanimated/commit/deb782556d03d86bcfdc8e9e92f06a7491aa757f#diff-8ee19000960c96e45bf813296fe1bc00203d9b26bc18e8c7f7a4dae6ca9682d7R238

szydlovsky commented 5 months ago

Hey @MaxGraey this finNodeHandle is not even needed on Web since the tags are used only for native platforms. The code is refactored in https://github.com/software-mansion/react-native-reanimated/pull/6030 and it should fix the warning.

km-tr commented 4 months ago

@szydlovsky I'm getting the same error in 3.12.1 as well. What do you think?

szydlovsky commented 4 months ago

@km-tr Yeah, I interpreted our release notes wrongly 😄 The fix will be present in 3.13 version

km-tr commented 4 months ago

@szydlovsky I understand. I'll wait for 3.13.