Package Exports
- react-native-windows
- react-native-windows/package.json
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-windows) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ReactNative for Windows 10 (C++)
See the official React Native website for an introduction to React Native. The master branch of this repository adds support for React Native for Windows10 implemented from scratch in C#. It reimplemented the JS<->Native bridge in C#, and shared the JS with Facebook's implementation of React Native. The current direction of React Native involves a closer interaction between C++ and JS which is hard to achieve with a separate C# implementation.
In this branch, we are working on a rewrite of React Native for Windows10 built in C++ that reuses the C++ core bridge implementation from Facebook’s React Native. This will allow React Native for Windows10 to innovate and provide features by sharing the same core as Facebook’s React Native. See Status for more details.
Getting Started
This is a summary of setup steps needed to install and work with React Native for Windows10 (C++). See the React Native Getting Started Guide for React Native details.
System requirements
- You can run React-Native for Windows10 apps only on Windows 10 devices; sdk version: 10.0.14393.795 or higher.
- Visual Studio 2017 with the following options:
- Workloads
- Universal Windows Platform development
- Enable the optional 'C++ Universal Windows Platform tools'
- Desktop development with C++
- Universal Windows Platform development
- Individual Components
- Development activities
- Node.js development support
- SDKs, libraries, and frameworks
- Windows 10 SDK (10.0.14393.0)
- Windows 10 SDK (10.0.17763.0)
- Development activities
- Workloads
Install dependencies
- Git
- Node.js (last verified with version 8.14.0)
- Chrome (optional, but needed for JS debugging)
- NuGet
AddNuGet.exe's location toPATH. - NuGet Credential Provider
AddCredentialProvider.VSS.exe's location toPATH.
Build Steps
Clone the repo
git clone https://github.com/Microsoft/react-native-windows.git cd react-native-windowsCheckout the rnwcpp-preview branch
git checkout rnwcpp-previewInstall dependencies. This step may take a while on the first run due to dependency download.
cd RNWCPP npm installBuild solution.
- Using MSBuild
MSBuild.exe [/p:Platform=$(TargetPlatform)] [/p:Configuration=$(TargetConfiguration)]- Using Visual Studio IDE
- Open
ReactWindows-UWP.sln. - Set your
Platformtox86orx64andConfigurationtoDebug. - Select
Project / Build Solution (Ctrl+Shift+B)
- Open
[Optional] Install react-devtools for enhanced JS debugging:
npm install -g react-devtools
Running the Sample Universal Windows App
- Run
npm run build. - Run
Scripts\launchPackager.bat. - [Optional] If you want to debug the JS code:
- Make sure Chrome is running if you're not already running it
- If you want to use the react-devtools that you installed earlier, run
react-devtools
- In Visual Studio, set React.Windows.Universal.SampleApp as the StartUp Project.
- If you didn't already, make sure to set your
Platformtox86orx64andConfigurationtoDebug.
- If you didn't already, make sure to set your
- Run project (
F5orDebug / Start Debugging). - If you chose to skip step 3 above, make sure to uncheck the "Web Debugger" checkbox.
- Press the "Load" button on the left side of the Windows 10 application window that appears.
The selected ReactNative app (defaulted to Bootstrap) should start in the bottom of the application window.
Try these samples by entering the JS file name and App names below into the textboxes at the top of the application window before pressing "Load":
- Sample: JavaScript file:
Universal.SampleApp\index.uwpApp Name:Bootstrap - RNTester: JavaScript file:
lib\RNTester\RNTesterApp.uwpApp Name:RNTesterApp
If you did choose to debug the JS code with "Web Debugger" enabled, Chrome should have loaded http://localhost:8081/debugger-ui/ in a new tab. Press F12 or Ctrl+Shift+I in Chrome to open its Developer Tools.
Note: If nothing happened, make sure you started the packager (and if debugging the JS code, Chrome and the react-devtools) before step 7.
Running Unit Tests
- Run
Scripts\UnitTest.ps1 [-Platform <test platform> -Configuration <test configuration>].
Running Integration Tests
PowerShell
- Run
Scripts\IntegrationTests.ps1 -Run. This runs all Desktop tests.
Visual Studio
- Run
Scripts\IntegrationTests.ps1to start the JS bundler and WebSocket server. - In the
Test Explorerwindow, select and run any desired tests.
Defaults for platform and configuration are x64, Debug.