React native on windows App
Really? If you are a react frontend dev if do yoy want create mobile app you can use react native, but if do yo want create app windows for the store … mmm … maybe i need create a c# app?, no!, you can create a react native windows.
React native windows is a react native branch, you can follow the Getting Started and dont jump any step.
Getting started, wow!, you need take a coofe cup, we begin:
- Check if your machine are windows 10 with Windows 10 SDK, check if your Windows version is 10.0.15063.0 or higher.
- Install latest node versión with chocolatey optional.
3. Install Visual Studio and customize the options follow the Windows Development Dependencies -> https://microsoft.github.io/react-native-windows/docs/rnw-dependencies
4. Install Visual Code with React Native Tools Extension.
4. Follow the React Native Cli Quickstart (Windows + Android) up the development environment : https://reactnative.dev/docs/environment-setup
Now you are ready for create your first App, you need open your visual code like admin and follow this steps:
Install global packages only the first time:
npm i react-native -g
npm i react-native-windows-init -g
And now you can do
npx react-native init <project name> --version ^0.61.5
cd <project name>
npx react-native-windows-init --overwrite
npx react-native run-windows
The first time you will be waiting 3/5 min, you can see on your terminal
The command run-windows show a second cmd window with metro task to build the bundle like this
When the bundle is loading:
And when then App is loaded:
Yeah!, we do it, we have a fantastic react native app, you can search your app on the windows task bar
And if do you want you can up to microsoft store
Enjoy it :)
Main documentation: https://github.com/microsoft/react-native-windows
Examples: https://github.com/microsoft/react-native-windows-samples