React-native-gesture-handler: Unable to resolve GestureHandlerRootView

Created on 2 Feb 2020  路  16Comments  路  Source: software-mansion/react-native-gesture-handler

Just installed 1.5.4 and got the following error, goes away when i drop back down to 1.5.3

Screenshot 2020-02-02 at 17 05 53

Most helpful comment

I'm facing the same issues

All 16 comments

I'm facing the same issues

Same here

I'm having the same issue

I switched back to 1.5.3. that seemed to work. "npm install [email protected]" works with all other current up to date navigation packages

Same here, I have been struggling with this for a long time now.

Also, it is not even working with version 1.5.3

try version 1.5.0

Not working, below is my package.json

"dependencies": {
    "@react-native-community/masked-view": "0.1.5",
    "axios": "^0.19.2",
    "expo": "~36.0.0",
    "moment": "^2.24.0",
    "react": "~16.9.0",
    "react-dom": "~16.9.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz",
    "react-native-reanimated": "~1.4.0",
    "react-native-safe-area-context": "0.6.0",
    "react-native-screens": "2.0.0-alpha.12",
    "react-native-web": "~0.11.7",
    "react-navigation": "^4.1.0",
    "react-navigation-stack": "^2.0.16",
    "react-redux": "^7.1.3",
    "redux": "^4.0.5",
    "redux-logger": "^3.0.6",
    "redux-promise-middleware": "^6.1.2",
    "redux-thunk": "^2.3.0",
    "validator": "^12.2.0"
  },
  "devDependencies": {
    "babel-preset-expo": "~8.0.0",
    "@babel/core": "^7.0.0"
  },

Same here, I do the same, downgrade to 1.5.3 and solves the problem

@ygortgaleno It isn't working for me, I tried downgrading the version but same result.

@ygortgaleno
also i dont know if you tried, but first uninstall the handler already installed and then install 1.5.3
try this, this seems to stable.
"dependencies": {
"@react-native-community/masked-view": "^0.1.5",
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-gesture-handler": "^1.5.3",
"react-native-reanimated": "^1.4.0",
"react-native-safe-area-context": "^0.6.2",
"react-native-screens": "^2.0.0-alpha.22",
"react-navigation": "^4.0.10",
"react-navigation-stack": "^2.0.10",
"react-navigation-tabs": "^2.7.0"
},

Screenshot from my emulator...
react-error

I got this same error, downgrading to 1.5.3 worked for me too!

It seems that the issue is because of not mentioning the GestureHandlerRootView.js file the in package.json file
As a temporary solution you can go to this file:
/node_modules/react-native-gesture-handler/gestureHandlerRootHOC.js and use the code below instead:

import React from 'react';
import { StyleSheet } from 'react-native';
import hoistNonReactStatics from 'hoist-non-react-statics';
import { View } from 'react-native';

export default function gestureHandlerRootHOC(
  Component,
  containerStyles = undefined
) {
  function Wrapper() {
    return (
      <View style={[styles.container, containerStyles]}>
        <Component {...this.props} />
      </View>
    );
  }

  Wrapper.displayName = `gestureHandlerRootHOC(${Component.displayName ||
    Component.name})`;

  hoistNonReactStatics(Wrapper, Component);

  return Wrapper;
}

const styles = StyleSheet.create({
  container: { flex: 1 },
});

Terribly sorry for that. Just released 1.5.5 with the fix.

IT WORKED HERE!!
Steps: In the project folder...

  1. sudo rm -rf node_modules/ and rm -rf yarn.lock
  2. I change the version of the react-native-gesture-handler (package.json) for 1.5.3, without ^.
  3. And then yarn install and worked here.

Me encontrei com mesmo erro e resolvi colocando a vers茫o 1.4.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chhornponleu picture chhornponleu  路  3Comments

brentvatne picture brentvatne  路  4Comments

neiker picture neiker  路  3Comments

nguyenhose picture nguyenhose  路  4Comments

rgangopadhya picture rgangopadhya  路  4Comments