Friday, October 27, 2017

Setting rootView.appProperties doesn't re-render root component

Leave a Comment

I'm not modifying initial props:

RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation                                                       moduleName:@"DcWealth"                                                initialProperties:nil                                                    launchOptions:launchOptions];  self.rootView = rootView; 

only saving the instance self.rootView = rootView

and after some event happens on native side, I want to pass different props:

self.rootView.appProperties = @{ ... }; 

but my root view doesn't re-render and get new props. (it does if I manually reload the JS)

docs say that:

It is fine to update properties anytime. However, updates have to be performed on the main thread.

I checked and I update properties on main thread.

What could be causing this problem?

Related github issue: https://github.com/facebook/react-native/issues/15938

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment