My router is this. Is there a way where a variable will tell what screen should display?
export const HomeNavigator = TabNavigator({
...
Search:{
screen: usertype == 1? Customer : Handyman,
},
...
});
export const RootStack = StackNavigator({
Login: {screen: Login}
Home:{screen: HomeNavigator},
...
},{
headerMode: 'none'
});
export default RootStack;
After the user logged in his account, the application will check his account type. Then his account type will tell what screen should display in the Search tab:
if the user's account type is 1 the screen that should display is customer.js
if the user's account type is 2 the screen that should display is Handyman.js