I am facing this error I don't know what might be the reason as I am new in react native I am exporting all possible packages modules and libraries but still could resolve this issue.
CodePudding user response:
propably wrong package name
"react-navigation-stack" not to be confused with package "@react-navigation/stack"
on your second screenshot i see you are using a package that has been removed from react-native. In order to install it, take a look at community packages. to find out the corresponding package name google the following:
react native community "NAME-OF-THE-PACKAGE"
CodePudding user response:
Follow this steps
- First of all install React Navigation
npm: npm install @react-navigation/native
or
yarn: yarn add @react-navigation/native
- React Navigation works on react-native-screens so install this
npm: npm install react-native-screens react-native-safe-area-context
or
yarn: yarn add react-native-screens react-native-safe-area-context
- then install stack navigation
npm: npm install @react-navigation/stack
or
yarn: yarn add @react-navigation/stack
- after that, You also need to install react-native-gesture-handler.
npm: npm install react-native-gesture-handler
or
yarn: yarn add react-native-gesture-handler
- after that, You also need to install react-native-masked-view/masked-view if you want to use different navigation animation i recommend you to install this even if you don't want to use animations.
npm: npm install @react-native-masked-view/masked-view
or
yarn: yarn add @react-native-masked-view/masked-view
references: https://reactnavigation.org/docs/getting-started https://reactnavigation.org/docs/stack-navigator