You can either use autolinking on react-native-windows 0.63 and later or manually link the module on earlier realeases.
RNCConfig supports autolinking. Just call: npm i react-native-config --save
npm install react-native-config --save
- Open your solution in Visual Studio 2019 (eg.
windows\yourapp.sln
) - Right-click Solution icon in Solution Explorer > Add > Existing Project...
- Add
node_modules\react-native-config\windows\RNCConfig\RNCConfig.vcxproj
- Right-click main application project > Add > Reference...
- Select
RNCConfig
in Solution Projects - In app
pch.h
add#include "winrt/RNCConfig.h"
- In
App.cpp
addPackageProviders().Append(winrt::RNCConfig::ReactPackageProvider());
beforeInitializeComponent();
Do the same steps as for 0.62, but use node_modules\RNCConfig\windows\RNCConfig61\RNCConfig.vcxproj
in step 4.
If you want to contribute to this module Windows implementation, first you must install the Windows Development Dependencies.
You must temporary install react-native-windows
package. Versions of react-native-windows
and react-native
must match. E.g. if the moudule uses [email protected]
, install npm i react-native-windows@^0.62 --dev
.
Now, you will be able to open corresponding RNCConfig...sln
file, e.g. RNCConfig62.sln
for [email protected]
.