Unable to resolve module 'react-native-screen'
If you have downloaded react-navigation then it wont work without its supporting Libs which are react-native-gesture-handler ,react-native-reanimated, react-native-screens
you can download it via yarn or npm .
npm install react-native-gesture-handler react-native-reanimated react-native-screens
or
yarn add react-native-gesture-handler react-native-reanimated react-native-screens
Hope it helps. feel free for doubts
You need to install 3 more libs react-native-gesture-handler
, react-native-reanimated
, and react-native-screens
.
npm install --save react-native-gesture-handler react-native-reanimated react-native-screens
Refs: https://reactnavigation.org/docs/en/getting-started.html#installing-dependencies-into-a-bare-react-native-project
Use below steps, this will work 100%.
- Install React Navigation
npm install react-navigation
- Install Dependencies
expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view
- Install React Navigation Stack
npm install react-navigation-stack @react-native-community/masked-view
- Start the app and clear cache with npm start -c
Update Imports
imports will look like this:
import { createAppContainer } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';
Errors? If you are still seeing errors and complaints about packages, do the following:
rm -r node_modules
rm package-lock.json
expo upgrade
npm start -c