mirror of
https://github.com/status-im/react-native.git
synced 2025-01-10 17:45:59 +00:00
57b0039ce1
Summary: To get on par with iOS this PR adds an `appProperty` to the `ReactRootView`. The documentation on the iOS side is here: [https://facebook.github.io/react-native/docs/communication-ios.html#properties.](https://facebook.github.io/react-native/docs/communication-ios.html#properties.) You can pass in initial props with the `startReactApplication` method: ```java … Bundle initialProps = new Bundle(); bundle.putString(“initialKey”, “initialValue”); mReactRootView.startReactApplication(mReactInstanceManager, "HelloWorld", initialProps); setContentView(mReactRootView); … ``` And later on properties can be updated this way: ```java … // Update props Bundle updatedProps = mReactRootView.getAppProperties(); updatedProps.putString(“someOtherKey”, “someOtherValue”); mReactRootView.setAppProperties(updatedProps); // Replace props Bundle newProps = new Bundle(); newProps.putString(“someKey”, “someValue”); mReactRootView.setAppProperties(newProps); … Closes https://github.com/facebook/react-native/pull/13430 Reviewed By: AaaChiuuu Differential Revision: D4896483 Pulled By: javache fbshipit-source-id: 7c752d6bbf5dc500874b49dcff80db772e83915f