-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drawer defaultStatus="closed" not honoured on initial load #837
Comments
Note this seems to happen in both web and mobile... |
👍 |
# Why expo/router#837 ExpoRouter provides a `SafeAreaContextProvider` with an initial value of `0` for all dimensions. The `drawer` layout uses these dimensions to calculate the necessary x offset for its 'closed' state. These calculations assume a minimum screen size, so having `0` caused it to initially render on the screen # How We only need these initial values for static rendering, so now we only provide them when rendering SSR. # Test Plan Tested manually by creating a new project. # Checklist - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin).
Same issue |
This needs to be fixed upstream in react-navigation react-navigation/react-navigation#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 |
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. |
Same problem here, any solutions? |
# Why expo/router#837 ExpoRouter provides a `SafeAreaContextProvider` with an initial value of `0` for all dimensions. The `drawer` layout uses these dimensions to calculate the necessary x offset for its 'closed' state. These calculations assume a minimum screen size, so having `0` caused it to initially render on the screen # How We only need these initial values for static rendering, so now we only provide them when rendering SSR. # Test Plan Tested manually by creating a new project. # Checklist - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin).
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 (
<Pressable onPress={() => { props.navigation.toggleDrawer() }}>
);
},
}}
The text was updated successfully, but these errors were encountered: