As expo bloats our app with unnecessary dependencies, we will be looking at react-native cli to create a bare-bones react native app.
A simple "Hello World" app is 25 mb in size when made with expo. So we are going to look at the alternative for it.
This post is a part of the react-native series I am currently writing on.
Now go to your terminal and type the below code,
npx react-native init Project
There is no need to install react native cli globally like expo cli as said in its documentation.
Now go into the project folder.
cd Project
You can now run and build the app for your own operating system with the following command.
npx react-native run-android
npx react-native run-ios
You can plug in your device and enable usb debugging as said in this website aboutreact to run your built app on you physical device directly,
Or you can use an emulator to run your app.
That's how you can create your first react-native app without expo cli and build and run it on your android/iOS emulator or in a physical device.
In my next post I will discuss about the React Native elements like View, Text etc.,
Thank you for reading!!
Check out my portfolio: Gautham's portfolio
Check out my blog: coding-magnified.tech
Top comments (7)
Hey, you’re saying it’s 25Mb with expo, but what’s the size with react-native CLI ?
Its less than 5-10 mb for a "Hello world app" for react native cli app
I’m not judging expo or RN CLI, but it’s good to know that the size of the app is so much bigger with expo. Thanks 😊
Thank you stan!
Expo is for people who have literally no knowledge about react native or mobile app development.
So it would be better if you start with it first.
But for production, react native cli is must!!
react-native run-android
Will work?
Naa bro. in docs its given like it and I use the same thing said in the post.