React Native Windows Init CLI
This guide will give you more information on the React Native Windows Init CLI. Note: This command will only work for RNW <e; 0.75. If you are using RNW >e; 0.76, you should use the init-windows
command instead.
react-native-windows-init
react-native-windows-init
is a CLI used to bootstrap the addition of the Windows platform to react-native
projects.
Usage
Run npx react-native-windows-init --overwrite
from an existing react-native
project, to installreact-native-windows
and generate initial project files for Windows.
Options
Here are the options that react-native-windows-init
takes:
Option | Input Type | Description |
---|---|---|
--help | boolean [default: false] | Show help. |
--version | string | The version of react-native-windows to use. |
--namespace | string | The native project namespace. This should be expressed using dots as separators. i.e. 'Level1.Level2.Level3'. The generator will apply the correct syntax for the target language. |
--verbose | boolean [default: false] | Enables logging. |
--language | string ["cs","cpp"] [default: "cpp"] | The language the project is written in. |
--projectType | string ["app","lib"] [default: "app"] | The type of project to initialize (supported on 0.64+). |
--overwrite | boolean [default: false] | Overwrite any existing files without prompting. |
--useWinUI3 | boolean [default: false] | [Experimental] Targets WinUI 3.0 (Preview) instead of UWP XAML. |
--useHermes | boolean [default: false] | [Experimental] Use Hermes instead of Chakra as the JS engine (supported on 0.64+ for C++ projects). |
--experimentalNuGetDependency | boolean [default: false] | [Experimental] change to start consuming a NuGet containing a pre-built dll version of Microsoft.ReactNative. |
--telemetry | boolean [default: false] | Controls sending telemetry that allows analysis of usage and failures of the react-native-windows CLI. |
This sends telemetry to Microsoft by default. You can prevent the telemetry from being sent by using the --no-telemetry
command line option. See below for more details.
Data Collection
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft's privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
This data collection notice only applies to the process of creating a new React Native for Windows app with the CLI.