Push from SingleScreen to TabBased in Wix React Native Navigation
Push from SingleScreen to TabBased in Wix React Native Navigation
There are documentation and examples of navigating from tab view to other single views. But I can't find any information about navigating from a single view to a tab view.
Is there a possibility to this.props.navigator.push
to view with tabs somehow?
If not is there are some workarounds to achieve that?
this.props.navigator.push
1 Answer
1
You should do something like this:
Your main stack navigator:
import HomeScreenTabs from '../yourpath/TabNavigator';
const MainStack = createStackNavigator(
HomeScreen:
screen: HomeScreenTabs,
,
SingleViewScreen1:
screen: SomeSingleViewScreen,
navigationOptions: ...
,
SingleViewScreen2:
screen: SomeOtherSingleViewScreen,
navigationOptions: ...
,
Your tab navigator:
//Your 3 tab screens
import Home from '../Home';
import Profile from '../Profile ';
import Feedback from '../Feedback ';
const Tabs = createBottomTabNavigator(
Home:
screen: Home
,
Profile:
screen: Profile
,
Feedback:
screen: Feedback
,
export default Tabs;
And in order to navigate to the Tabs screen from e.g. SingleViewScreen1
you would do this.props.navigation.navigate('HomeScreen')
.
SingleViewScreen1
this.props.navigation.navigate('HomeScreen')
Oh. Apologies. Confused with
react-navigation
:D (btw if you want to give it a try I strongly recommend it, it's really powerful)– iuliu.net
Aug 25 at 8:50
react-navigation
I think I'll have to because I can't do such a simple thing with a Wix navigation.
– Roo
Aug 25 at 9:05
You'll thank yourself in the future. react-navigation is the way to go. And is also the preffered navigation system chosen by Expo, so you know it's good. :D
– iuliu.net
Aug 25 at 9:11
@iuliu.net react-navigation is NOT a native navigation system like Wix navigation. There is a big performance step-up when using a native navigation system like Wix. Native navigation runs on UI thread unlike react-navigation which runs on JS thread. It really has everything react-navigation has, it just has a slightly different API.
– Christos Lytras
Aug 30 at 22:36
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
I'm using a Wix React Native Navigation.
– Roo
Aug 25 at 8:44