Tried to register two views with the same name RNGestureHandlerButton

后端 未结 8 2118
臣服心动
臣服心动 2021-02-05 17:35

I try to create navigation with { createStackNavigator, createAppContainer } from \'react-navigation\' but when a start my application i always receive error

I try a lo

相关标签:
8条回答
  • 2021-02-05 18:23

    So I'm using expo SDK32 and had the same issue.

    I 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?

    I think this is what @feihcsim was talking about in their answer.

    0 讨论(0)
  • 2021-02-05 18:24

    For non-Expo applications, the above-given solution does work out. So, for react-native applications made in ANDROID Studio here is the solution:-

    • Replace your react-native-linked dependency version with its the latest version currently latest is 2.1.1 which gives this error, replace it with this link - version "https://github.com/xcarpentier/react-native-linkedin.git" along with required changes.
    • Delete and reinstall node_module.
    • After installing, either delete the WEBVIEW folder from "react-native-linked" in node_module manually or write the below the line in your script in the package.json file: "postinstall": "npx jetifier; patch-package; rm -rf ./node_modules/react-native-linkedin/node_modules/react-native-webview", after "start" key.
    0 讨论(0)
提交回复
热议问题