Expo router | Switch from tab navigation to Stack navigation adds space on top

I'm trying expo with expo-router for a project. When i switch from tab navigation to stack navigation, It creates a double header one is the tab header & stack screen header. I don't want to show tab header in stack screen

enter image description here

Upvotes: 0

Views: 278

Answers (1)

Dokt
Dokt

Reputation: 199

In your _layout.tsx file (where you declare your component), simply add headerShown : false to the screenOptions prop of the Tab component.

Like so :

 <Tabs
    
      screenOptions={({ route }) => ({
        headerShown: false
      }) 
 />

Hope it helps.

Upvotes: 0

Related Questions