Closed anam-hossain closed 2 years ago
If you replace the header
element with view
, the error goes away. There's something wrong with header
element but I don't know what it is yet.
HI @anam-hossain , can you provide minimal code reproduction on snack for the same?
I'm having a similar issue only in iOS when i upgrade from 2.13.8 to 2.13.12 Reverting the version resolve the problem for me.
Im Using header in a custom component only
const AppHeader = ({
left,
body,
right,
}) => (
<Header
iosBarStyle="light-content"
style={styles.header}
>
<Left style={styles.left}>
{left}
</Left>
<Body style={styles.body}>
{body}
</Body>
<Right style={styles.right}>
{right}
</Right>
</Header>
);
const styles = StyleSheet.create({
header: {
justifyContent: 'space-between',
backgroundColor: Colors.primaryLayout,
alignItems: 'center',
},
left: {
flex: 0.5,
// marginLeft: Spacing.SPACING_S,
},
body: {
flex: 1,
justifyContent: 'center',
alignItems:'center',
},
right: {
flex: 0.5,
// marginRight: Spacing.SPACING_S,
},
});
@hanykumar I am usually using React native CLI and have very little experience with Expo. So, It will be difficult for me to set up a demo with Expo.
I think @romonsalve have found the problem. Could you able to check what changes in v2.13.12?
Having the same issue on iOS only. I feel like the header is a bit tall. I didn't change any config of the header.
@hanykumar I'm having a similar issue as @anam-hossain, my header kind of bounces when navigating to it.
Here is a expo example https://snack.expo.io/@eric_vesst/header-glitch Only happens with iOS.
If I use the headerLeft/headerRight that react-navigation has, there is not glitch like that.
Finally I debugged more and fond that its happening when we are loading headers based on scene.
"native-base": "^2.13.12",
"react": "16.11.0",
"react-native": "0.62.2",
"react-native-gesture-handler": "~1.6.0",
"react-native-reanimated": "~1.9.0",
"react-native-router-flux": "^4.2.0",
Code like below:
App.js
<Router>
<Stack key="root">
<Scene openDrawer={this.openDrawer} initial navBar={HomeHeader} key="home" component={Home} />}
<Scene openDrawer={this.openDrawer} navBar={Header} key="profile" component={User} />
<Scene openDrawer={this.openDrawer} navBar={Header} path="/support" key="support" component={Support} />
</Stack>
</Router>
HomeHeader:
<HeaderBase>
<Left>
<Button onPress={() => Actions.pop()} transparent>
<Icon name='arrow-back' />
</Button>
</Left>
<Body>
<Title onPress={() => Actions.support()}>HeaderBase</Title>
</Body>
<Right>
<Button transparent>
<Icon name='menu' />
</Button>
</Right>
</HeaderBase>
Header:
<Left>
<Button onPress={() => Actions.pop()} transparent>
<Icon name='arrow-back' />
</Button>
</Left>
<Body>
<Title onPress={() => Actions.support()}>HeaderBase</Title>
</Body>
<Right>
<Button transparent>
<Icon name='menu' />
</Button>
</Right>
</HeaderBase>
If I change <Scene openDrawer={this.openDrawer} initial navBar={HomeHeader} key="home" component={Home} />}
to <Scene openDrawer={this.openDrawer} initial navBar={Header} key="home" component={Home} />}
(make header same for all scene) works.
duplicate #3236
FYI the same bouncy effect happens when you show/hide the Footer
component.
Do we have a solution for this?
Any updates?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi guys, Nativebase header is glitching with the latest version of react-navigation (v5.3.1). I have attached a gif file to demonstrate the glitch.
I am using a native base header with a custom component.
The code looks like the following:
node, npm, react-native, react and native-base version, expo version if used, xcode version
node: v10.18.0 react-native: 0.61.5 react 16.9.0 native-base: 2.13.12 xcode 11.3