Getting Started with React Native Windows

  1. Install the development dependencies
  2. Install React Native for Desktop
  3. Running a React Native Windows App
  4. Links

While React Native is primarily used to build apps for Android and iOS devices, it also supports creating Universal Windows Platform (UWP) apps through React Native for Desktop.

Install the development dependencies

  1. Enable Developer Mode in Windows Settings App.
  2. Install the latest verion of Visual Studio 2022 with the following options:
    • Workloads
      • Node.js development
      • .NET Desktop development
      • Desktop development with C++
        • Include MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest) (check under ‘Optional’)
      • Universal Windows Platform development or Windows application development
        • Include C++ (v143) Universal Windows Platform tools (check under ‘Optional’)
    • Individual Components
      • Include Windows 10 SDK (10.0.19041.0)
      • Include MSVC v143 - VS 2022 C++ ARM64 build tools (Latest)
  3. Enable Long Paths in Windows.
  4. Install the latest version of the .NET 6.0 SDK.

Once you have installed everything, you can run the following command in PowerShell to verify that all mandatory requirements are met:

1
2
Set-ExecutionPolicy Unrestricted -Scope Process -Force;
iex (New-Object System.Net.WebClient).DownloadString('https://aka.ms/rnw-vs2022-deps.ps1');

Install React Native for Desktop

Run @react-native-community/cli init in the directory where you want to save your project:

1
npx --yes @react-native-community/cli@latest init <projectName> --version "latest"

This will create the project in a new subdirectory, then you can navigate into that folder:

1
cd <projectName>

Add React Native Windows to your project’s dependencies:

Yarn:

1
yarn add react-native-windows@^0.76.0

or NPM:

1
npm install --save react-native-windows@^0.76.0

Initalize the React Native Windows native code and projects:

1
npx react-native init-windows --overwrite

Running a React Native Windows App

Run the following command in your project folder:

1
npx react-native run-windows

This will open a new Command Prompt window that looks like this:

If everything runs smoothly, your app will open as well: