-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
[iOS] bug with @react-navigation/bottom-tabs - initial jumping #1251
Comments
P.S: I thought this is the right repo to post this issue. If you feel I have to post this at react-navigation, let me know. |
Can you post this simple repo with the changed applied with e.g. |
@WoLewicki I got rid of it with headerTransparent:true + remove of initialMetrics and some refactoring of my navigators, but I still think that this is bug, because it does not work with all combinations. |
Hmm if you think this is a bug on |
@WoLewicki I will provide a reproduction soon. I think it is indeed a bug on rns. |
Here is repo with reproduced bug: https://github.com/pt7892/rnscreens-bottom-tab-flicker also videos: Simulator.Screen.Recording.-.iPhone.13.Pro.Max.-.2022-01-28.at.16.17.29.mp4Screen.Recording.2022-01-28.at.16.16.25.movIf initial tab screen is simple, you may not notice this, thats why i added bunch of From what i understand, on tab change, if stack is being mounted first time, 2 |
@pt7892 is the jumping behavior connected to the flicker issue you posted here? |
I also have the similar issue. But it happens not only in Initial rendering. My packages: "@react-navigation/bottom-tabs": "^6.2.0", |
@hirbod Do you have a workaround for it? |
@vladyslavNiemtsev please provide a reproduction of this issue then so we can work on it, otherwise we cannot do much about it. |
hey, when I set But I still have a problem with content cut off on Android. |
I think this issue was about |
He is indeed right. It is also jumping on android. Only headerTransparent was helping for me |
Just a small point here, if you have headerShown: false in your BottomTabNavigator when you enable it - jumping disappears |
@WoLewicki this is still a thing. If you use the header provided by BottomTab, there is no jumping. But when you have a nested stack as a tab, you don't want to use the header from the BottomTab, instead you wan't to use the header provided by the nested stack. This jumping is still super annoying and there is no real way around it. It just looks like the insets where applied too late and thats what cause the drops. There are repos available in the issue tracker, there is even a duplicated issue: Would be awesome if we could resolve this. |
I tried to debug and solve this some time ago but I did not manage to find a solution. If you have any time frame to debug it, it would be really helpful. |
I’m experiencing the same issue. It seems to be related to the With With I found a workaround for this. Instead of using import { useSafeAreaInsets } from 'react-native-safe-area-context';
import PropTypes from 'prop-types';
import styled from 'styled-components/native';
const StyledView = styled.View`
background-color: black;
flex: 1;
padding-bottom: ${({ insets }) => insets.bottom}px;
padding-top: ${({ insets }) => insets.top}px;
`;
export const SafeAreaView = ({ children, ...otherProps }) => {
const insets = useSafeAreaInsets();
return (
<StyledView {...otherProps} insets={insets}>
{children}
</StyledView>
);
};
SafeAreaView.propTypes = {
children: PropTypes.node,
};
SafeAreaView.defaultProps = {
children: null,
}; |
|
Fixed this by swapping
|
## ✅ What's done - [x] Changed to use stack instead of native stack because the screen flashed in the bottom tab - react-navigation/react-navigation#10175 - software-mansion/react-native-screens#1276 - software-mansion/react-native-screens#1251
You cannot use |
I've tried using the custom |
@aymather please show the smallest reproducible example possible |
@l0gicgate Ok so I've tried reproducing the problem... and of course... no dice... but I have recreated a very basic environment to demonstrate a working concept if anyone wants to view it / try to reproduce the problem from there. Here is the repository. (I'll also just add that this environment was created with I did, however, fix the problem in my app by upgrading Now... I thought that the version might have something to do with the problem, so when I first tried to reproduce the problem, the version that came in when i added For anyone who is still facing this issue, I'd say try removing the package from your project completely, and reinstalling it. Try the |
Any update on this? Edit: After wrapping my App with |
Hey! 👋 The issue doesn't seem to contain a minimal reproduction. Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem? |
I'm currently experiencing this issue. Tried all of the solutions above and no luck. |
Any update on the above issue? |
Facing the same issue! |
Faced the same issue today This solution worked |
Description
When using @react-navigation/bottom-tabs with RNS, the content jumps on tab change (one the first render only).
I made sure I've tested this plenty of times.
The bug does not occur if I import
but with
My whole is wrapped with
SafeAreaProvider
fromreact-native-safe-area-context
like so:I also tried to test it without initialMetrics and also used
SafeAreaView
(from react-native-safe-area-context and react-native), but it still jumped for me.I also patched react-navigation bottoms tabs with this PR applied by @WoLewicki
react-navigation/react-navigation#9772
But the jump still occur. Also made sure to disable/enable freeze etc.
I couldn't manage to prevent the initial jumping. See my video attached.
Screenshots
I created a dead simple preview, see my Video below. Please watch the in the center.
https://streamable.com/i7upqv
Expected behavior
Should not jump on initial render
Actual behavior
It jumps on initial render and it does look weird
Reproduction
Happens on iOS, snack not helping here.
Platform
Workflow
Package versions
The text was updated successfully, but these errors were encountered: