React-native-gesture-handler: Tried to register two views with the same name RNGestureHandlerButton

Created on 5 Feb 2019  路  13Comments  路  Source: software-mansion/react-native-gesture-handler

react-navigation 3.1.3- it's use RNGH
react-native-gesture-handler 1.0.15

During i try to import anything from react-native-gesture-handler, for example:
import {RectButton} from 'react-native-gesture-handler';
i got error :

simulator screen shot - iphone x - 2019-02-05 at 08 58 45

Most helpful comment

If you are using Expo to build your react native app you do not have to import react-native-gesture-handler from npm or yarn. It is already in the expo package. If you import the package you will experience this error.

All 13 comments

if you're using expo make sure you're using the latest version of it. if you're not, then delete your node_modules and yarn.lock/npm-lock.json and reinstall. https://github.com/react-navigation/react-navigation-native/blob/master/package.json#L91 this should flatten out to 1 rngh dependency. if this doesn't help then please create a new issue with a reproducible example

If you are using Expo to build your react native app you do not have to import react-native-gesture-handler from npm or yarn. It is already in the expo package. If you import the package you will experience this error.

i delate node modules then install it again avery thing is ok try it

I had the same issue after I upgraded the library from v1.0.10 to v1.2.1.
I solved by upgrading the react-navigation library, too from v3.0.1 to 3.9.1.

If you are using Expo to build your react native app you do not have to import react-native-gesture-handler from npm or yarn. It is already in the expo package. If you import the package you will experience this error.

If you are using Expo to build your react native app you do not have to import react-native-gesture-handler from npm or yarn. It is already in the expo package. If you import the package you will experience this error.

any solution for that??

For anybody else struggling with Expo, what has worked for me is:

expo r -c - which clears the packager cache, then simply go with npm start and should be good

I'm using expo and uninstall react-native-gesture-handler.

Then,

Unable to resolve "react-native-gesture-handler" from "node_modules\@react-navigation\native\src\Scrollables.js"

appear

Anyone who comes here looking for something that works after you have already tried:

  1. rm -rf node_modules && npm install with no luck.
  2. Removing react-native-gesture-handler from your package.json and doing rm -rf node_modules && npm install with no luck...

I had success by making sure my version of react-native-gesture-handler was only allowing patch changes in the semver.

old package.json line _(when name collision error was happening)_:
"react-native-gesture-handler": "^1.0.12",
_(The ^ here tells npm to bump to highest minor version, which installed version 1.4.1)_

new package.json line _(fixed the error for me)_:
"react-native-gesture-handler": "~1.0.12",
_(The ~ here tells npm to only bump the highest patch version, which installed 1.0.17 and the error was gone)_

I'm assuming some kind of collision was happening having different minor versions?

Hi all,

I have this error, I tried all solution before, remove node_modules, expo r -c, but ever same error.
My expo cli version is 3.22.1, node is 14.5.0 and this is my package.json:

{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"test": "jest --watchAll"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/samples": "~36.0.0",
"@expo/vector-icons": "^10.2.0",
"@react-native-community/masked-view": "0.1.10",
"@react-navigation/web": "^1.0.0-alpha.9",
"expo": "38.0.8",
"expo-app-auth": "~9.1.1",
"expo-apple-authentication": "~2.2.1",
"expo-asset": "~8.1.7",
"expo-av": "~8.2.1",
"expo-constants": "~9.1.1",
"expo-crypto": "~8.2.1",
"expo-facebook": "~8.2.1",
"expo-firebase-analytics": "^2.4.1",
"expo-font": "~8.2.1",
"expo-google-app-auth": "^8.1.2",
"expo-keep-awake": "~8.2.1",
"expo-linear-gradient": "~8.2.1",
"expo-linking": "^1.0.3",
"expo-sharing": "~8.2.1",
"expo-sqlite": "~8.2.1",
"expo-svg-uri": "^1.1.0",
"expo-web-browser": "^8.3.1",
"firebase": "^7.16.0",
"lodash": "^4.17.19",
"moment": "^2.27.0",
"prop-types": "^15.7.2",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz",
"react-native-circular-timer": "^1.1.4",
"react-native-firebase": "^5.6.0",
"react-native-gesture-handler": "1.6.1",
"react-native-progress-circle": "^2.1.0",
"react-native-reanimated": "~1.9.0",
"react-native-safe-area-context": "3.1.1",
"react-native-screens": "2.9.0",
"react-native-shimmer-placeholder": "git+https://github.com/tomzaku/react-native-shimmer-placeholder.git#expo",
"react-native-snap-carousel": "^3.9.1",
"react-native-svg": "12.1.0",
"react-native-svg-transformer": "^0.14.3",
"react-native-svg-uri": "^1.2.3",
"react-native-swipe-list-view": "^3.1.3",
"react-native-swipe-up-down": "^1.0.7",
"react-native-swipeable-flat-list": "^0.1.2",
"react-native-view-shot": "3.1.2",
"react-native-web": "^0.13.3",
"react-navigation": "^4.4.0",
"react-navigation-stack": "~2.8.2",
"react-navigation-tabs": "^2.9.0",
"react-redux": "^7.2.0",
"react-redux-firebase": "^3.6.0",
"react-with-firebase-auth": "^1.3.2",
"redux": "^4.0.5",
"redux-actions": "^2.6.5",
"redux-firebase-middleware": "^1.2.0",
"redux-firestore": "^0.13.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"@babel/core": "^7.10.4",
"babel-eslint": "^10.1.0",
"babel-preset-expo": "^8.2.3",
"eslint": "^7.4.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-universe": "^4.0.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-react": "^7.20.3",
"jest-expo": "^38.0.2",
"node-sass": "^4.14.1",
"react-native-sass-transformer": "^1.4.0"
},
"eslintConfig": {
"extends": "universe/native"
},
"private": true
}

@lmbuffetti Hi, have you managed to solve it?

I have been struggling with this error for hours, tried all possible combinations but still the same error.

@lmbuffetti Hi, have you managed to solve it?

I have been struggling with this error for hours, tried all possible combinations but still the same error.

https://github.com/th3rdwave/react-native-safe-area-context/issues/110#issuecomment-660407790 I have solved this way

Hi There!
I found this solution and was a very good shoot:

"Yes I had the same problem it's because you have two version of react native gesture handler u have to delete the one in the folder of your app: node_module/expo/node_modules/react-native-gesture-handler"

Bests!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexthebake picture alexthebake  路  3Comments

neiker picture neiker  路  3Comments

chrisdrackett picture chrisdrackett  路  4Comments

Agoujil2saad picture Agoujil2saad  路  3Comments

brentvatne picture brentvatne  路  5Comments