我不会修改最初的props :
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"DcWealth"
initialProperties:nil
launchOptions:launchOptions];
self.rootView = rootView;
只保存了self.rootView = rootView
个实例
在本地发生一些事件后,我想传递不同的props :
self.rootView.appProperties = @{ ... };
但我的根视图不会重新渲染并获得新props .(如果我手动重新加载JS,就会发生这种情况)
docs.说:
可以随时更新属性.但是,必须在主线程上执行更新.
我判断并更新了主线程上的属性.
是什么导致了这个问题?
相关github问题:https://github.com/facebook/react-native/issues/15938