4
votes

In React Native for iOS, RCTRootView has a writable property appProperties which can be used to pass arguments from native code to react-native modules, described in this link: Communication iOS. When set, in react-native side, this.state will change and trigger an update.

But in Android, ReactRootView doesn't have a similar setter to modify the launchOption (which is passed in ReactRootView.startReactApplication(manager, moduleName, launchOptions))

So the question is: is there a solution to set react-native module's state for Android?

2

2 Answers

1
votes

Actually you can set some launchOptions (a bundle) on startReactApplication but you have to call it on an existing ReactRootView instance. But there is still the question on how to update the properties on runtime.

0
votes

Currently on Android I have to create a NativeModule to update these launch options. Please have a check in the official documentation