I am encountering a problem when using animations with FlatList. Specifically, when I use Animated or useAnimatedStyle from Reanimated for tab animations, the following issues occur:
The TextInput in the second tab (and onwards) doesn't gain focus when tapped.
Any TouchableOpacity or button inside the FlatList items also becomes unresponsive.
When I switched from Reanimated's useAnimatedStyle to Animated from React Native, the issue was resolved, and everything worked as expected. This appears to be a problem with how useAnimatedStyle interacts with FlatList.
Steps to reproduce
Copy the code below into a fresh React Native project.
Run the app.
Try focusing on the TextInput in the second tab or pressing any button inside the second tab.
Comment out Reanimated usage and use React Native's Animated instead to observe the difference.
Description
I am encountering a problem when using animations with FlatList. Specifically, when I use Animated or useAnimatedStyle from Reanimated for tab animations, the following issues occur:
The TextInput in the second tab (and onwards) doesn't gain focus when tapped. Any TouchableOpacity or button inside the FlatList items also becomes unresponsive. When I switched from Reanimated's useAnimatedStyle to Animated from React Native, the issue was resolved, and everything worked as expected. This appears to be a problem with how useAnimatedStyle interacts with FlatList.
Steps to reproduce
Copy the code below into a fresh React Native project. Run the app. Try focusing on the TextInput in the second tab or pressing any button inside the second tab. Comment out Reanimated usage and use React Native's Animated instead to observe the difference.
Snack or a link to a repository
https://snack.expo.dev/_cgYFhPQvKDe1htoimwii
Reanimated version
3.16.1
React Native version
0.76
Platforms
Android
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes