Scroll events randomly stop working in development
Description
This has been happening for many weeks so we got used to it but I figured I'd file an issue in case it isn't known.
Renimated events like useAnimatedScrollHandler sometimes just stop working in the simulator. It definitely happens on iOS but I'm pretty sure I've seen it happen on Android. I don't believe it happens on the web.
A reliable way to get them "unstuck" is to save a file inside react-native-reanimated. I'm not sure whether it matters which file to save. I usually have WorkletEventHandler.ts open at all times because I save it many times per day to trigger whatever the thing that gets it unstuck. I can check later whether saving other files also helps.
Steps to reproduce
I don't have an exact consistent repro, but it does happen literally every day.
So I bet if you screw around with https://github.com/bluesky-social/social-app you'll eventually run into it too.
Snack or a link to a repository
https://github.com/bluesky-social/social-app
Reanimated version
3.4.2
React Native version
0.72.5
Platforms
Android, iOS
JavaScript runtime
Hermes
Workflow
None
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
iOS simulator
Device model
No response
Acknowledgements
Yes
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?
@gaearon believe this is related to issues with the simulator I found e.g. that simulator doesn't return velocity readings in a PanGesture https://stackoverflow.com/questions/70390265/uipangesturerecognizer-velocity-return-0-in-simulator-macbook-m1
Why does saving a file inside node_modules always fix it?
Hi @gaearon, just to be curious - does this happen when you attach the same handler to multiple components? If yes, then my comment applies here as well.
This doesn't seem related to me — I think I started seeing this before we started passing events to multiple handlers (and it's still happening after we stopped doing that).
@gaearon I messaged you in Discord because I have some trouble building Bluesky to test it.
This seems like it hasn't happened for a long while fwiw.