question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unsupported top level event type "onGestureHandlerStateChange" dispatched

See original GitHub issue

I am getting crash when I touch the PanGestureHandler.

return (
			<PanGestureHandler
				onGestureEvent={this.onGestureEvent}
				onHandlerStateChange={this.onHandlerStateChange}
			>
				<Animated.View style={[style, panStyle]} {...rest}>
					{children}
				</Animated.View>
			</PanGestureHandler>
		);

package.json

    "react-native-gesture-handler": "1.0.8",
    "react": "^16.5.0",
    "react-native": "^0.57.2",

android versions:

  compileSdkVersion 27
    buildToolsVersion '27.0.3'

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 27
  }

    implementation "com.android.support:appcompat-v7:27.1.1"

crash log

Unsupported top level event type "onGestureHandlerStateChange" dispatched
extractEvents
    ReactNativeRenderer-dev.js:2471:6
extractEvents
    ReactNativeRenderer-dev.js:1016:8
runExtractedEventsInBatch
    ReactNativeRenderer-dev.js:1070:4
<unknown>
    ReactNativeRenderer-dev.js:2713:6
batchedUpdates$1
    ReactNativeRenderer-dev.js:15311:14
batchedUpdates
    ReactNativeRenderer-dev.js:2616:31
_receiveRootNodeIDEvent
    ReactNativeRenderer-dev.js:2711:17
receiveEvent
    ReactNativeRenderer-dev.js:2731:26
__callFunction
    MessageQueue.js:349:47
<unknown>
    MessageQueue.js:106:26
__guard
    MessageQueue.js:297:10
callFunctionReturnFlushedQueue
    MessageQueue.js:105:17

related issue: https://github.com/expo/expo/issues/2067

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:38
  • Comments:205 (15 by maintainers)

github_iconTop GitHub Comments

670reactions
balthazarcommented, Dec 3, 2018

Because my navigators were created asynchronously, the handler was registered too late and thus throwing this error. I fixed the issue by simply doing:

import 'react-native-gesture-handler'

at the top of my index.js 🙂

134reactions
fsmaioranocommented, Feb 6, 2019

@brendandestefano

Try put this import in the first index.js of your application.

Like this:

import "react-native-gesture-handler";

import { AppRegistry } from "react-native";  

import App from "./src/App";

import { name as appName } from "./app.json";

Read more comments on GitHub >

github_iconTop Results From Across the Web

ios - Unsupported top level event type ...
A drawer is working properly in Android and iPhone 5S. But, when I ran the app in iPhone X, it's throw error when...
Read more >
iOS : Unsupported top level event type ... - YouTube
iOS : Unsupported top level event type " onGestureHandlerStateChange dispatched in iphone X [ Beautify Your Computer ...
Read more >
Developers - Unsupported top level event type ... - Bountysource
Unsupported top level event type "onGestureHandlerStateChange" dispatched.
Read more >
台部落
Unsupported top level event type "onGestureHandlerStateChange" dispatched. 开发环境如如下:. "react-native": "0.55.4",.
Read more >
現象 - Qiita
Unsupported top level event type "onGestureHandlerStateChange" dispatched · 現象 · version · 解決方法 · 注意点.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found