You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 20, 2025. It is now read-only.
Enable CodePush for react-native-windows v0.50+ (#1051)
In react-native-windows v0.50+, we added ReactNativeHost, which has better support for running React Native in the background as well as embedding React Native in other controls besides XAML Pages.
Copy file name to clipboardExpand all lines: docs/setup-windows.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,14 +22,14 @@ Once you've acquired the CodePush plugin, you need to integrate it into the Visu
22
22
23
23
### Plugin Configuration (Windows)
24
24
25
-
After installing the plugin, you need to configure your app to consult CodePush for the location of your JS bundle, since it will "take control" of managing the current and all future versions. To do this, update the `AppReactPage.cs` file to use CodePush via the following changes:
25
+
After installing the plugin, you need to configure your app to consult CodePush for the location of your JS bundle, since it will "take control" of managing the current and all future versions. To do this, update the `MainReactNativeHost.cs` file to use CodePush via the following changes:
26
26
27
27
```c#
28
28
...
29
29
// 1. Import the CodePush namespace
30
30
usingCodePush.ReactNative;
31
31
...
32
-
classAppReactPage : ReactPage
32
+
classMainReactNativeHost : ReactNativeHost
33
33
{
34
34
// 2. Declare a private instance variable for the CodePushModule instance.
35
35
privateCodePushReactPackagecodePushReactPackage;
@@ -38,7 +38,7 @@ class AppReactPage : ReactPage
38
38
// specifying the right deployment key, then use it to return the bundle URL from
39
39
// CodePush instead of statically from the binary. If you don't already have your
40
40
// deployment key, you can run "code-push deployment ls <appName> -k" to retrieve it.
41
-
publicoverridestringJavaScriptBundleFile
41
+
protectedoverridestringJavaScriptBundleFile
42
42
{
43
43
get
44
44
{
@@ -48,7 +48,7 @@ class AppReactPage : ReactPage
48
48
}
49
49
50
50
// 4. Add the codePushReactPackage instance to the list of existing packages.
CodePushUtils.Log("More than one CodePush instance has been initialized. Please use the instance method codePush.getBundleUrlInternal() to get the correct bundleURL for a particular instance.");
0 commit comments