useAnimatedStyle with transform crashes the app
See original GitHub issueDescription
I was trying to create a collapsable jumbotron for my app but whenever I use useAnimatedStyle with the combination of useAnimatedScrollHandler the app crashes without any logs whatsoever. I’m getting these crashes both on iOS and android.
Expected behavior
Not to crash.
Actual behavior & steps to reproduce
Provided in snack
Snack or minimal code example
https://snack.expo.dev/bXKLBIm4b
Package versions
| name | version |
|---|---|
| react-native | 0.66.4 |
| react-native-reanimated | ^2.3.1 |
Affected platforms
- Android
- iOS
- Web
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
useAnimatedStyle | React Native Reanimated
This hook is one of the main elements of the new Reanimated v2 API. It allows for creating an association between shared values...
Read more >GestureDetector gesture handler app crash when calling ...
GestureDetector gesture handler app crash when calling external function ... const animatedStyle = useAnimatedStyle(() => ({ transform: ...
Read more >How to use Reanimated 2 (a beginners guide)
Let's start with an app that renders a 100x100 image. ... { useSharedValue, useAnimatedStyle, } from 'react-native-reanimated'; ...
Read more >react native reanimated not working - You.com | The search ...
I solve this problem by only using useAnimatedStyle and interpolate . ... 2.3.0 onwards of react-native-reanimated this is crashing the app on launch....
Read more >Expo App crashes when I call useDrawerProgress hook from ...
Hello, I have a Bottom tab navigator nested in a Drawer navigator and I'm trying to create this drawer UI in an app....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hey, unfortunately, you can’t mix Reanimated v1 with v2. You should use
interpolateinstead ofinterpolateNode. I noticed that you mentioned that this issue still occurs even if you useinterpolate. I have already checked this and this works for me, could you check this example on the newest version 2.4.1, and let me know if it works?code
you are right react-native-reanimated v2 make me confused when you use
interpolateNodeinsideuseAnimateStyleit will crash withuseShareValueso i useinterpolateinstead ofinterpolateNodehere is my working example react-native-reanimatedv2