magicismight / react-native-root-siblings

A sibling elements manager.
MIT License
698 stars 134 forks source link

when have one more AppRegistry.registerComponent ,switch them ,it wont work #52

Open yutianhaijiao opened 4 years ago

yutianhaijiao commented 4 years ago

AppRegistry.registerComponent("xx", () => xx); AppRegistry.registerComponent("yy", () => yy); in this case ,when i am only in xx ,it is work ok. but when i am from xx to yy, then back xx, it wont show anything

GreyGao commented 4 years ago

the same issue

GreyGao commented 4 years ago

@yutianhaijiao I think I fix it use <RootSiblingParent> wrap the App.js:

  <Provider store={globalStore}>
        <ThemeProvider theme={theme}>
          <RootSiblingParent>
            <View style={{ flex: 1 }}>
              <AppContainer ref={(navigatorRef) => { NavigationService.setTopLevelNavigator(navigatorRef); }} />
            </View>
          </RootSiblingParent>
        </ThemeProvider>
      </Provider>
yutianhaijiao commented 4 years ago

@GreyGao Thanks ,it is good for work .but I do not understand why

wscotten commented 4 years ago

Thank you so much! This solved our issue.

tastafur commented 4 years ago

Hello,

Test with jest render app, it's not work, I've tried to mock him and I have not been able.

Captura de pantalla 2020-03-06 a las 13 18 27

Thanks

godot007 commented 3 years ago

4.x有BUG。使用3.1.2以上就行了。

mouxuefei commented 3 years ago

有人和react-native-navigation一起吗,没法实现全局