bug with @react-navigation/bottom-tabs - initial jumping and flickering #1276
Description
Description
When I'm using @react-navigation/bottom-tabs
with the native stack navigator, the header jumps on android and sometimes flickers on iOS on tab change (on the first render only). But it doesn't happen if I use the JS stack navigator.
I wrapped NavigationContainer
with SafeAreaProvider
like this:
<SafeAreaProvider initialMetrics={initialWindowMetrics}>
<NavigationContainer>
<RootStack />
</NavigationContainer>
</SafeAreaProvider>
I also patched react-navigation bottoms tabs with this PR applied by @WoLewicki
react-navigation/react-navigation#9772
If I remove initialWindowMetrics
jump on Android is gone, but on iOS, the header is still flickering.
it maybe related to this issue
Screenshots
Screen.Recording.2022-01-21.at.14.10.59.mov
ScreensFlickering.mov
Steps To Reproduce
- Open app.
- Click on Tab2.
- See the position of the header.
Expected behavior
the header should not jump on android and flicker on iOS(on initial render).
Actual behavior
on initial render, header jumps on Android and flickers on iOS
Reproduction
reproduction repo:
https://github.com/IvanIhnatsiuk/native-stack-bottom-jump
Platform
- iOS
- Android
- Web
- Windows
- tvOS
Workflow
- Managed workflow
- Bare workflow
Package versions
package | version |
---|---|
react-native | 0.66.4 |
@react-navigation/native | 6.0.9 |
@react-navigation/native-stack | 6.2.5 |
react-native-screens | 3.10.2 |
react-native-safe-area-context | 3.3.2 |
react-native-gesture-handler | 2.2.0 |
react-native-reanimated | 2.3.1 |
@react-navigation/bottom-tabs | 6.0.9 |