-
Install React Native command line interface using NPM:
npm install -g react-native-cli
-
Initialize your React Native project
Next, generate a React Native project. In the directory you would like your React Native Windows project directory, run:
react-native init <project name> --version 0.59.10
Navigate into this newly created directory:
cd <project name>
-
Install the React Native Windows command line interface (rnpm-plugin-windows).
If you are using Yarn, run
yarn add rnpm-plugin-windows
Alternatively, if you are using NPM, run
npm install --save rnpm-plugin-windows
-
Next, initialize your React Native Windows
vnext
in the project directory. This step may take a while during first run due to dependency download.react-native windows --template vnext
Note: Make sure Chrome is launched and running before running a React Native Windows app.
-
Without Visual Studio
In your React Native Windows project directory, run:
react-native run-windows
A new Command Prompt window will open with the React packager as well as a
react-native-windows
app. This step may take a while during first run since it involves building the entire project and all dependencies. You can now start developing! 🎉 -
With Visual Studio
- Open the solution file in the application folder in Visual Studio (e.g.,
AwesomeProject/windows/AwesomeProject.sln
) - Select the
Debug
configuration and thex64
platform from the combo box controls to the left of theRun
button and underneath theTeam
andTools
menu item. - Run
yarn start
from your project directory, and wait for the React Native packager to report success. - Click the
Run
button to the right of the platform combo box control in VS, or select theDebug
->Start without Debugging
menu item. You now see your new app and Chrome should have loadedhttp://localhost:8081/debugger-ui/
in a new tab. PressF12
orCtrl+Shift+I
in Chrome to open its Developer Tools. 🎉
- Open the solution file in the application folder in Visual Studio (e.g.,