software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
6.13k stars 982 forks source link

Fix : RN 0.76 attachHandlerWithTag Crash #3224

Closed ChanghyeonYoon closed 11 hours ago

ChanghyeonYoon commented 4 days ago

Description

I don't know the exact reason for the absence of the handler, but it should work fine if you change it to that code. I think it's probably a flow issue when using React Native 0.76 New Architecture with React Navigation v7. Anyway, you can change the code to the following and it should work fine.

Test plan

ChanghyeonYoon commented 4 days ago

Related Issue #3184 #3206

m-bert commented 11 hours ago

Hi @ChanghyeonYoon! First of all, thank you for submitting this PR. Unfortunately, this is not a solution that we want to implement, so I have to close it.

I don't know the exact reason for the absence of the handler

The fact that handler doesn't exist is connected to StrictMode. The thing is, if you enable StrictMode in your application, renders and effects will be called twice. For some reason (we are yet to find out why), order of operations on iOS when new architecture is enabled is different than on the old one. In other words, handler is dropped, and then checked if it exists. This will fail, but for now we don't know what causes this difference.