Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported top level event type "onGestureHandlerStateChange" dispatched #439

Closed
musicode opened this issue Jan 31, 2019 · 14 comments
Closed

Comments

@musicode
Copy link

OS: ios
RN version: 0.58.3
RNGH version: 1.0.15

image

@sinhpn92
Copy link

sinhpn92 commented Feb 1, 2019

I have same issue with:

"react-navigation": "^3.1.0",
"react-native-gesture-handler": "^1.0.15",

I did put import 'react-native-gesture-handler' on top of index.js but it's doesn't work :(

@wbercx
Copy link

wbercx commented Feb 11, 2019

Version 1.0.14 does not seem to have this problem.

@Simek
Copy link

Simek commented Feb 12, 2019

@kmagiera Can we get a status or an update about this issue?

@kmagiera
Copy link
Member

cc @osdnk

@Simek
Copy link

Simek commented Feb 12, 2019

I'm experiencing this exception on iOS while navigating back in StackNavigator using swipe or back button.

Other React Navigation users also suffered from this issue and seems that most of them go with downgrade: react-navigation/react-navigation#5208

Only three commits has been added between 1.0.14 and 1.0.15 and after a bit of research I can tell that changes from commit 35c57a0 (#429) are causing this exception but I'm not sure why.

@osdnk
Copy link
Contributor

osdnk commented Feb 13, 2019

Hello, could you please assure that you're actually requiring RNGH on very top level of your app. I mean you could add some console.log on top of GestureHandler.js and then determine whether it's really invoking on App's start.

@kmagiera
Copy link
Member

Hello all!

Thanks for reporting the issue, however in the future it would be much easier for us to address your problems quicker, if you help us and prepare a small repo that reproduces the problem.

I went ahead to try it and started new project with RN 0.58.4 and GH 1.0.15 (similar setup to what @musicode posted) here https://github.com/kmagiera/GHBug439 – apparently the problem cannot be reproduced there.

It makes sense to try @osdnk suggestion and add the following code to your main javascript file (e.g. usually it is App.js file):

require('react-native-gesture-handler');

Gesture handler lib requires that parts of the library code runs on load time (specifically even registration code that is the reason why you're seeing the crash).

@osdnk
Copy link
Contributor

osdnk commented Feb 14, 2019

rel #320

@osdnk
Copy link
Contributor

osdnk commented Feb 14, 2019

I have testes the newest version with an Example app on 0.58.4 and 0.58.0 version of RN on Android and iOS in release and debug mode as well and still can't observe the problem. I believe it's possible that it breaks in some cases, but I'm seriously not able to reproduce.

If you face with a problem please attach an example with newest version of RN and RNGH and deterministic steps to observe the case.

@wbercx
Copy link

wbercx commented Mar 3, 2019

For what it's worth, I've just upgraded from RN 0.55.4 to 0.58.6 and no longer seem to have this issue.

Prior to that, it occurred anytime I used any version of RNGH > 1.0.14, but only on iOS. Android has always been fine for me.

EDIT: I should add that the error happened to me when navigating to a new screen in a (react-navigation) stackNavigator, and then pressing the back button in the top header. Again, iOS only.

@Simek
Copy link

Simek commented Mar 3, 2019

Issue is still occurring with RN 0.58.6 and RNGH 1.0.17 in my iOS app. Same circumstances as @wbercx mentioned. Also "swipe back" gesture (swipe from most left edge of display) generates this error for me. Not much changed from last message: #439 (comment).

EDIT:
Yesterday I have moved my whole app navigation structure to https://github.com/kmagiera/GHBug439 but unfortunately exception didn't occurred even after that.

@tikkichan4
Copy link

Just facing the same problem in 0.59.0 when i turn on inlineRequires in metro.config.js which introduced in react native 0.59.0. After i change inlineRequires to false, everything works fine.

But inlineRequires off can causes slower app launches. Looking forward the answer which can turn on inlineRequires without conflicting react-native-gesture-handler.

@nicholasrq
Copy link

nicholasrq commented Mar 23, 2019

same issue as @tikkichan4 on RN 0.59 and react-native-gesture-handler@1.1.0 with inlineRequires: true

@osdnk
Copy link
Contributor

osdnk commented Mar 26, 2019

Closing in favor of #320.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants