reactnativecn / react-native-website

React Native 中文网
https://reactnative.cn
MIT License
216 stars 327 forks source link

iOS上使用RN混合开发,多个RCTRootView对应一个RCTBridge比较好,还是一个RCTRootView就对应一个RCTBridge比较好? #677

Closed CFPanda closed 1 year ago

CFPanda commented 1 year ago

请按以下格式提供问题的相关信息。

问题的具体描述

请描述完整的环境/版本信息

预期结果

sunnylqm commented 1 year ago

省资源优化 -> 共用 业务强隔离 -> 不共用

CFPanda commented 1 year ago

我采用了共用的方案,但是在使用过程中遇到了一个问题,就是只能显示一个RCTRootView 代码如下:我添加了两个view,但只能显示了rctView1的内容

CFPanda commented 1 year ago
截屏2022-12-05 上午10 06 47
sunnylqm commented 1 year ago

需要你自己控制页面的切换和显隐

CFPanda commented 1 year ago

现在是我先add rctView1,rctView2就不显示,但是我先添加rctView2的话,rctView1就不显示,好像这两个view没办法同时显示,你说需要自己控制页面的显示和隐藏,具体是指怎么控制呢?

sunnylqm commented 1 year ago

不然你要怎么显示呢?你添加九个页面,九个自动变成九宫格吗?那当然是原生有自己的导航方法,自己决定页面的显示、隐藏、布局、跳转啊

CFPanda commented 1 year ago

我的代码已经决定了 我的页面布局了啊,就是一个native的view上add了两个rn的view,所在的区域和大小我都给了,不应该都显示么

github-actions[bot] commented 1 year ago

👋 Hey there, it looks like there has been no activity on this issue in the last 90 days. Has the issue been fixed, or does it still require the community attention? This issue will be closed in the next 7 days if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 1 year ago

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.