Home > Back-end >  Navigation In react native android/ios
Navigation In react native android/ios

Time:03-01

enter image description here

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.

enter image description here

CodePudding user response:

propably wrong package name

"react-navigation-stack" not to be confused with package "@react-navigation/stack"

installation guide

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

  1. First of all install React Navigation

npm: npm install @react-navigation/native or yarn: yarn add @react-navigation/native

  1. 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

  1. then install stack navigation

npm: npm install @react-navigation/stack or yarn: yarn add @react-navigation/stack

  1. 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

  1. 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

  • Related