Skip to content

Instantly share code, notes, and snippets.

@JorensM
Created January 14, 2024 13:54
Show Gist options
  • Save JorensM/d3a0c46e00b7ab861fc3db3cf5a256ec to your computer and use it in GitHub Desktop.
Save JorensM/d3a0c46e00b7ab861fc3db3cf5a256ec to your computer and use it in GitHub Desktop.
expo-router bug report
// 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