Skip to content

Conditionally Show/Hide Routes in expo-router + BottomTabNavigator (withLayoutContext) #28878

Discussion options

You must be logged in to vote

I eventually figured it out...

For my admin Tab screen I can add a redirect prop as such:

    <MaterialBottomTabs.Screen
			name="admin"
			options={{
				title: `Admin`,
			}}
                        redirect={ !isAdmin}
    />

Epiphany moment from this video.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pjmvp
Comment options

Answer selected by pjmvp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant