-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forcing view refresh #1049
Comments
@finalquest - you can pass data using an eventDispatcher by creating it with RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:jsCodeLocation
moduleProvider:nil
launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"YourModuleName"]; Alternatively you can look at calling |
Hi. Thanks again |
🚀 |
@brentvatne @finalquest I'm facing a more complex situation. We have a existing app that use a UITableView and would like to make each cell to be a RCTRootView, but how can we pass data to the JS module so it can initialize with different content? |
The RCTRootView has a property called |
@ide But how to access the initialProperties in JS land? And as we are sharing a bridge via
and creating more cells using
We'd expect 'dynamic' data passed to the module not the bridge. Thank you . |
The initialProperties are passed in as the props of your root React component. It's good that you are sharing a bridge. I was thinking there would be noticeable latency when rendering your cells (have to render an entire React hierarchy + create all of the initial UIViews) so you might see flickering if you were to quickly scroll through a list of cells. |
@ide Thanks for the tip, rootView.initialProperties does work. |
…e is blank on first load
@ssssssssssss whats the FPS you arrived in case of each cell is react micro app ? Have you tried of reusing RCTRootView? @ide Any drawbacks of re using RCTRootView. |
I've ran into a similar issue where we had to parse native urls and pass them to an already rendered react native view. There's a property called
|
Hi.
Putting some context first.
I'm using RN as the V in MVC, in an existing app.
I've created a plain UIView class, and then added a subview(RCTRootView) to it.
Then I added this view in mi viewController. So this RCTRootView is now the view of the controller.
Everything works fine. I've made my view layout in JS, and is rendered well.
But now I'm facing some fundamentals issues.
Is this posible to pass data to the RN view? Or force a refresh when the controller need to update some data?. In native is quite simple, as the texts/labels are plain IBOulets. But I dont really know how to do this having the actual view in the JS side.
If anyone can point me in the correct direction will be apreciated.
Thanks in advance.
Regards
The text was updated successfully, but these errors were encountered: