Reputation: 1920
I used the following commands to create a react app:
npm install react-native
npx create-react-app my-app
cd my-app
npm start
The I added the following line of code in the App.js
and reloaded the browser.
import {SafeAreaView} from 'react-native';
But it keeps showing the error:
./src/App.js
Module not found: Can't resolve 'react-native' in '/Users/sdan/Documents/Projects/my-app/src'
Upvotes: 0
Views: 121
Reputation: 2104
You are using react not react-native if you want to create and run react-native just flow document https://reactnative.dev/docs/environment-setup and then you can create react-native app like that:
npx react-native init AwesomeProject
Upvotes: 1