native-stack height does not update on iOS.
Current behavior
When using @react-navigation/native-stack, if there is some view that forces Stack navigator to be shorter, and then that view is removed, stack navigator on iOS does not update to occupy the free space. Works fine on Android and on web but does not work on iOS devices. Please see the attached expo snack for a simple demo.
Also, it works just fine on all platforms when using @react-navigation/stack but I was wondering if there is anything that can be done to fix this behaviour while using @react-navigation/native-stack.
Expected behavior
Expect the Stack.Navigator to occupy all the available space if the view that was occupying part of the height before is removed from view.
Reproduction
https://snack.expo.dev/@saikedo/d7d3b0
Platform
- [ ] Android
- [X] iOS
- [ ] Web
- [ ] Windows
- [ ] MacOS
Packages
- [ ] @react-navigation/bottom-tabs
- [ ] @react-navigation/drawer
- [ ] @react-navigation/material-bottom-tabs
- [ ] @react-navigation/material-top-tabs
- [ ] @react-navigation/stack
- [X] @react-navigation/native-stack
Environment
- [] I've removed the packages that I don't use
| package | version |
|---|---|
| @react-navigation/native | 6.0.11 |
| @react-navigation/stack | 6.2.2 |
| @react-navigation/native-stack | 6.7.0 |
| react-native-safe-area-context | 4.3.1 |
| react-native-screens | 3.15.0 |
| react-native | 0.68.2 |
| node | 18.6.0 |
| npm or yarn | 8.13.2 |
Couldn't find version numbers for the following packages in the issue:
@react-navigation/stack
Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.
Bump
I agree with @Saikedo. Can we get some clarifications on this? It's the latest version of @react-navigation/native-stack 6.9.7
I can confirm that it happens only on iOS and only when createNativeStackNavigator is used. Everything works as expected when createStackNavigator is used
Hey! Thanks for opening the issue. Seems that this issue is related to react-native-screens library which is a dependency of React Navigation. Can you also post your issue in this repo so that it's notified to the maintainers of that library? This will help us fix the issue faster since it's upto the maintainers of that library to investigate it.