software-mansion / react-native-reanimated

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

Animated.createAnimatedComponent() TypeError: Cannot read property 'remove' of undefined #6001

Closed psquizzle closed 2 months ago

psquizzle commented 2 months ago

Description

When running the following repository (will work in expo go) https://github.com/psquizzle/animated-component-issue.git

I get the following error in the latest version of reanimated "react-native-reanimated": "^3.11.0" and version 3.10.0 This was previously working with "react-native-reanimated": "~3.6.2"

Render Error Cannot read property 'remove' of undefined Source 461 462 463 464 465 this. _InlinePropManager.attachInlineProps(this, this._getViewInfo()); if (IS_WEB && this. props. exiting) { saveSnapshot (this._component as HTMLE lement) ; createAnimatedComponent.tsx (463:32) AnimatedComponent#componentDidUpdate

Steps to reproduce

  1. Run example repository
  2. If you remove the useEffect that sets loaded to "true" the crash won't happen. It only occurs on rerenders

Snack or a link to a repository

https://github.com/psquizzle/animated-component-issue.git

Reanimated version

3.11.0

React Native version

0.74.1

Platforms

iOS and Android

JavaScript runtime

Hermes

Workflow

Expo Go

Architecture

Paper (Old Architecture)

Build type

Debug app & production bundle

Device

Real device

Device model

iPhone 15 Pro Max

Acknowledgements

Yes

psquizzle commented 2 months ago

It seems that the issue was with my code I had animatedProps={{ value: 0 }} not to a shared value. Removing this fixes the issue.

Thank you for the great library guys :)