Tips
How to provide support React Native apps on the Windows platform?
React Native is a framework developed by Facebook that is used to build applications on native platforms. It is preferred by most developers, due to its speed, agility, and ability to build hybrid applications in multiple platforms with an interactive user interface (UI).
By default, React Native has built-in components and supportive packages, accessible through both the mobile native iOS and Android platforms. To access applications in the Windows platform, Microsoft developed a Windows extension for React Native.
Extending support for the React Native app on Windows
1. Create a react-native app with version 0.61.5 or newer.
2. To support react-native-macOS also, migrate the react-native-macOS for the version (0.61.5) or newer.
3. Open the terminal and navigate to the React Native project path and execute the following command to install React Native for Windows
npx react-native-windows-init –overwrite
4. The above command will create a Windows folder in the project:
5. Go to the root of the react-native folder in the terminal and execute the following command to run the React Native app in the windows platform:
npx react-native run-windows
or
Using Visual Studio, open the solution file in the application folder:
(e.g., react_native_windows_support/windows/react_native_w
6. Open the Visual Studio Installer and modify the components:
In the Workloads tab, enable Universal Windows Platform development, Mobile development with C++, Desktop development with C++, and Node.js development support.
7. Confirm that the target platform version is updated by checking the project
8. If the React Native localhost server is not triggered automatically, then go to the root of the react-native folder in the terminal and execute either of the following commands to manually run the React Native localhost:
npm start
or
yarn start