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.14k stars 982 forks source link

New architecture crashes on React Native < 0.74 (`Assertion failed: (hasNativeState<T>(runtime))`) #2912

Closed m-bert closed 6 months ago

m-bert commented 6 months ago

Description

As reported in this comment, Gesture Handler crashes on new architecture. Here is log from Xcode:

Assertion failed: (hasNativeState<T>(runtime)), function getNativeState, file jsi-inl.h, line 220.

After small investigation we found out that it is caused by changes introduced in #2766 (getting shadowNode in RNGestureHandlerModule.mm)

Steps to reproduce

Just clone reproduction repository and try to run iOS app with new architecture enabled

Snack or a link to a repository

https://github.com/Under-Warz/rngh_sample

Gesture Handler version

2.16.2

React Native version

< 0.74

Platforms

iOS

JavaScript runtime

None

Workflow

None

Architecture

Fabric (New Architecture)

Build type

None

Device

None

Device model

Irrelevant

Acknowledgements

Yes

github-actions[bot] commented 6 months ago

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?

m-bert commented 6 months ago

After discussion, we decided that our libraries (react-native-gesture-handler, react-native-reanimated, etc.) will support new architecture starting from React Native 0.74. Therefore, we won't be adding backward compatibility in this case.