Unable to build app after reanimated 2 installation in react native

1.3k Views Asked by At

I just ran into issues with reanimated 2 (2.7.0) while trying to build react native for ios with the following errors:

 ERROR  TypeError: Cannot add new property '__reanimatedHostObjectRef'

This error is located at:

in AnimatedComponent(View) (at createAnimatedComponent.tsx:693)
in Unknown
in StyledNativeComponent (created by Styled(Component))
in Styled(Component) (at sheet.tsx:13)
in PanGestureHandler (at sheet.tsx:12)
in SheetContainer (at staff.tsx:59)
in StaffSheet (at App.tsx:45)
in RCTView (at View.js:32)
in View (at App.tsx:40)
in ApolloProvider (at App.tsx:39)
in App (at renderApplication.js:48)
in RCTView (at View.js:32)
in View (at AppContainer.js:106)
in RCTView (at View.js:32)
in View (at AppContainer.js:133)
in AppContainer (at renderApplication.js:41)
in mobile(RootComponent) (at renderApplication.js:57), js engine: hermes

Any idea on how to resolve this?

1

There are 1 best solutions below

3
On BEST ANSWER

Related issue here: https://github.com/software-mansion/react-native-reanimated/issues/1517

Did you try to deep copy the object/array of objects using JSON.parse(JSON.stringify(items)) as mentioned in the thread?