Created
January 14, 2024 13:54
-
-
Save JorensM/d3a0c46e00b7ab861fc3db3cf5a256ec to your computer and use it in GitHub Desktop.
expo-router bug report
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app/_layout.tsx | |
import { Drawer } from 'expo-router/drawer'; | |
export const unstable_settings = { | |
// Ensure any route can link back to `/` | |
initialRouteName: 'index', | |
}; | |
type DrawerItemProps = { | |
name: string, | |
label: string, | |
title?: string, | |
hide?: boolean | |
} | |
const DrawerItem = ({ name, label, hide, title }: DrawerItemProps) => { | |
console.log("This doesn't log"); | |
return ( | |
<Drawer.Screen | |
name={name} | |
options={{ | |
drawerLabel: label, | |
title: title || label, | |
drawerItemStyle: { | |
display: hide ? 'none' : 'flex' | |
} | |
}} | |
/> | |
) | |
} | |
export default function Layout() { | |
return ( | |
<Drawer> | |
<DrawerItem | |
name='index' | |
label='Home' | |
title='Home' | |
hide={false} | |
/> | |
</Drawer> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment