Does every RCTRootView have its own javascript context?

时间:2016-04-04 05:58:23

标签: react-native

If we create multiple RCTRootViews in a single react native application and have them load different javascript bundles, are they going to be run in completely isolated contexts? Completely sandboxed and no conflicts at all?

1 个答案:

答案 0 :(得分:0)

如果捆绑包使用单独的网桥,那么您实际上是在创建多个同时运行的反应本机应用程序。因此,它们确实会被“沙盒化”而没有冲突。

但是,也可以使用相同的网桥加载不同的软件包,在这种情况下,不同的软件包将在一个单一的本机应用程序中使用,并且它们可以相互通信。