我不是在修改初始道具:
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"DcWealth"
initialProperties:nil
launchOptions:launchOptions];
self.rootView = rootView;
Run Code Online (Sandbox Code Playgroud)
只保存实例 self.rootView = rootView
在一些事件发生在本机方面后,我想传递不同的道具:
self.rootView.appProperties = @{ ... };
Run Code Online (Sandbox Code Playgroud)
但我的根视图不会重新渲染并获得新的道具.(如果我手动重新加载JS就会这样做)
文档说:
可以随时更新属性.但是,必须在主线程上执行更新.
我检查并更新主线程上的属性.
什么可能导致这个问题?
相关的github问题:https://github.com/facebook/react-native/issues/15938