Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When should I run `react-native start`?

Tags:

react-native

Just getting started with React-Native (for the non-CRNA/Expo case) and it's not clear to me after reading the react-native docs or Understanding the CLI when it's appropriate to run react-native start

react-native start --help simply says starts the webserver. Running react-native run-ios also starts the same server except it also actually runs it in the simulator.

Question: When is it appropriate to run react-native start vs. just running the simulators directly (i.e. react-native run-ios)?

like image 406
d3ming Avatar asked Jul 08 '17 23:07

d3ming


People also ask

What is React Native Start do?

React Native (also known as RN) is a popular JavaScript-based mobile app framework that allows you to build natively-rendered mobile apps for iOS and Android. The framework lets you create an application for various platforms by using the same codebase.


2 Answers

react-native start is same as npm start and like you said it's to start the react packager/server.

I have found myself in situations where I had to stop and start the server explicitly using npm start.

To start up a project, you use the react-native run-ios and it starts up both the simulator and the server but in cases where the app has been installed and you want to restart the server, you can stop it explicitly in the terminal and use react-native start or npm start to start it up again.

like image 193
Chiamaka Nwolisa Avatar answered Oct 12 '22 23:10

Chiamaka Nwolisa


Using react-native start when app already installed on device. Using react-native run-ios when we need to install app on device and start the server. But when we installed new package to our project, we need to restart server using react-native run-ios.

like image 32
Akbar Rachman Gifari II Avatar answered Oct 12 '22 22:10

Akbar Rachman Gifari II