In iOS, you can do rctRootView.appProperties = newProps, and it will update the root view with new props. On android it doesn't seem to be implemented.
This behavior is critical for my use case of incrementally adopting react native in a large android app.
I think I want a function like ReactRootView.updateProps(Bundle props) that would look something like
publicvoidupdateProps(BundlenewProps) {
WritableNativeMapappParams = newWritableNativeMap();
DoublerootTag = MagicallyGetTheRootTag() // <- the rootTag isn't actually stored anywhere at the momentappParams.putDouble("rootTag", rootTag);
appParams.putMap("initialProps", newProps);
finalCatalystInstancecatalystInstance = mReactInstanceManager.getCurrentReactContext().getCatalystInstance();
StringjsAppModuleName = this.getJSModuleName();
catalystInstance.getJSModule(AppRegistry.class).runApplication(jsAppModuleName, appParams);
}based on the startReactApplication fn
Before I made a PR I wanted to check my direction -- does it look reasonable? I think I'll have to store the rootTag on the ReactRootView instance, b/c I can't find anywhere else that it's already stored.
In iOS, you can do
rctRootView.appProperties = newProps, and it will update the root view with new props. On android it doesn't seem to be implemented.This behavior is critical for my use case of incrementally adopting react native in a large android app.
I think I want a function like
ReactRootView.updateProps(Bundle props)that would look something likebased on the startReactApplication fn
Before I made a PR I wanted to check my direction -- does it look reasonable? I think I'll have to store the rootTag on the ReactRootView instance, b/c I can't find anywhere else that it's already stored.