router
router copied to clipboard
Drawer defaultStatus="closed" not honoured on initial load
Which package manager are you using? (Yarn is recommended)
npm
Summary
When defaultStatus="closed" is set on a Drawer, the drawer starts open, then immediately animates closed...expected behaviour is that the drawer should start closed - with no animation...
Minimal reproducible example
<Drawer initialRouteName="home" defaultStatus="closed" screenOptions={{ headerStyle: {}, headerTintColor: "#000", headerTitleStyle: { fontWeight: "bold", }, header: (props) => { return ( <View> <Pressable onPress={() => { props.navigation.toggleDrawer() }}> <Ionicons name="menu" size={32} color="black" /> </Pressable> </View> ); }, }}
<Drawer.Screen
name="index" // This is the name of the page and must match the url from root
options={{
drawerLabel: "Home",
title: "overview",
}}
/>