expo / router

[ARCHIVE]: Expo Router has moved to expo/expo -- The File-based router for universal React Native apps
https://docs.expo.dev/routing/introduction/
1.36k stars 113 forks source link

Drawer defaultStatus="closed" not honoured on initial load #837

Open georgevicbell opened 1 year ago

georgevicbell commented 1 year ago

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 (

{ props.navigation.toggleDrawer() }}>
    );
  },
}}

<Drawer.Screen name="index" // This is the name of the page and must match the url from root options={{ drawerLabel: "Home", title: "overview", }} />

georgevicbell commented 1 year ago

Note this seems to happen in both web and mobile...

moedeveloper commented 1 year ago

I also have the same issue, and I have been struggling with it like two days now. I don't find any solution for it! this is the site map

image

https://github.com/expo/router/assets/16238332/9ae6a1c2-e141-4cb1-824a-8bd21fc0536f

that's what exactly happening at startup!

bkasten-rbi commented 1 year ago

👍

WKampel commented 10 months ago

Same issue

marklawlor commented 10 months ago

This needs to be fixed upstream in react-navigation https://github.com/react-navigation/react-navigation/pull/11398

We attempted to fix this in the linked commits, but we needed to revert due to other issues it caused. https://github.com/expo/expo/pull/24362/files

jehillert commented 6 months ago

I have this problem with react-native-drawer-layout. or very nearly the same. The right drawer is stuck open, while the left drawer works fine. And it's weird, I didn't have the issue for months, and suddenly it was there while I a bunch of drawers. I tried going back to find out where the behavior started, but it will get better and then not be there until the project is completely cleaned and restarted. But it shows up 100% of the time on deploy...

[UPDATE] I got it to go away by downgrading to react-native-drawer-layout version 3.0.0.

LucasTrombim commented 3 months ago

Same problem here, any solutions?