Skip to content
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

DefaultRenderer and navigationState not working #3146

Closed
icerockq opened this issue Jul 26, 2018 · 1 comment
Closed

DefaultRenderer and navigationState not working #3146

icerockq opened this issue Jul 26, 2018 · 1 comment

Comments

@icerockq
Copy link

Version

Tell us which versions you are using:

  • react-native-router-flux 4.0.0-beta.31
  • react-native v0.55.4
  • native-base v2.7.1

Expected behaviour

const Scenes = Actions.create(
        <Scene key="root" >
            <Scene key="loginScene"  hideNavBar={true}>
                <Scene key="fish" component={Fish}/>
                <Scene key="login" component={Login}/>
            </Scene>

            <Stack key="homeScene" component={homeContainer} initial hideNavBar={true}>
                    <Scene key="home"  component={Home} />
                    <Scene key="search" component={Search} />
            </Stack>
        </Scene>
);
class App extends React.Component{
    render(){
        return (
            <StyleProvider style={getTheme(theme)}>
                <Router scenes={Scenes} />
            </StyleProvider>
              );
    }
}

And there is a homeContainer component:

class homeContainer extends Component{

  render(){
    const state = this.props.navigationState;
    const children = state.children;

    return(
        <Container>
        <DefaultRenderer navigationState={ children[0] } onNavigate={ this.props.onNavigate }  />
        <Footer>
          <FooterTab>
              <Button vertical>
                  <Icon name="settings" />
                  <Text style={{color:'#fff'}}>Настройки</Text>
              </Button>
              <Button
              onPress={() =>{
                  Actions.search();
              }}
                  vertical>
                  <Icon name="search" />
                  <Text style={{color:'#fff'}}>Поиск</Text>
              </Button>
              <Button
              onPress={() =>{
                  Actions.home();
              }}
                  vertical active>
                  <Icon active name="chatboxes" />
                  <Text style={{color:'#fff'}}>Чаты</Text>
              </Button>
              <Button vertical>
                  <Icon name="person" />
                  <Text style={{color:'#fff'}}>Профиль</Text>
              </Button>
          </FooterTab>
        </Footer>

      </Container>
    )
  }
}

But for some reason, DefaultRenderer does not work. And as there is no data in navigationState.
How can I get a navigationState about his children?
If possible, attach links to examples or code, if not difficult. Many thanks.

@aksonov
Copy link
Owner

aksonov commented Aug 8, 2018

There is NO DefaultRenderer within v4, you have to use custom navigators from React Navigation

@aksonov aksonov closed this as completed Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants