Closed JackGzj closed 7 years ago
Ok, that is how I do it.
I have a function like this in "app.js" (the file where you set up tab navigator).
changeTab = (key, value) => { this.setState({[key]: value}) }
You can then add the function to the screen/view (how ever you call it) like below
`
`
In the Whatever component you can link like below
<..... onPress={() => this.props.changeTab('selectedTab', 'TabYouWantToSelect')}
Hope that helps
Glad you fixed it @JackGzj
Three is three tab items in my app, I want to jump to the second one on pressing the button in the first page, but if I use the navigator to jump to the page that contains the tab navigator, the tab page will be unmounted, and every time I press will lead to the whole page remount.I want to make the effect that when I press the button on the page, I will jump to the second page just like pressing the tab bar icon, how can I do that?