galio-org / galio

Galio is a beautifully designed, Free and Open Source React Native Framework
https://galio.io/
MIT License
3.11k stars 321 forks source link

NavigationContainer with GalioProvider #256

Closed webcluster4u closed 1 year ago

webcluster4u commented 1 year ago

Hi, I am new to React Native and am trying to edit a bunch of codes to adapt them to my needs. The vendor has an App.js page which has below entry inside

  render() {
    if (!this.state.isLoadingComplete) {
      return (
        <AppLoading
          startAsync={this._loadResourcesAsync}
          onError={this._handleLoadingError}
          onFinish={this._handleFinishLoading}
        />
      );
    } else {
      return (
              <NavigationContainer>
              <GalioProvider theme={nowTheme}>
                <Block flex>
                  <Screens />
                </Block>
              </GalioProvider>
              </NavigationContainer>
      );
    }
  }

I am doing navigation in Pro.js which is a Screen like below:

              <Button
              textStyle={{ fontFamily: 'montserrat-regular', fontSize: 12 }}
              style={styles.button}
              onPress={() => navigation.navigate("App")}
              //onPress={() => navigation.navigate('Register', { screen: 'Register' })}
            >

But, I am getting below error:

The action 'NAVIGATE' with payload {"name":"Register"} was not handled by any navigator.

Do you have a screen named 'Register'?

If you're trying to navigate to a screen in a nested navigator, see https://reactnavigation.org/docs/nesting-navigators#navigating-to-a-screen-in-a-nested-navigator.

This is a development-only warning and won't be shown in production.