Skip to content
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

HeaderCenter Inconsistent Behavior #612

Closed
ryanmcgough opened this issue Aug 22, 2020 · 1 comment
Closed

HeaderCenter Inconsistent Behavior #612

ryanmcgough opened this issue Aug 22, 2020 · 1 comment

Comments

@ryanmcgough
Copy link

Hello,

I was testing out potentially moving towards createNativeStackNavigator() over createStackNavigator() and have been experiencing some inconsistent behavior regarding alignment with the headerLeft, headerCenter, and headerRight options. I initially tried using an image, but it was either slightly off centered to the right, or breaking out of the header bar. To test if it was a styling issue i tried using just <Text />, and each time i reload the app the text may appear in different spaces. Below are some variations of where the text may appear:

Screen Shot 2020-08-22 at 12 56 04 PM
Screen Shot 2020-08-22 at 12 56 13 PM
Screen Shot 2020-08-22 at 1 27 11 PM

Another piece I noticed is this appears to only be happening on any iOS 13 device. The above issue does not happen on any iOS prior.

Below are some code snippets as well as package versions:

Packages:

"react": "16.13.1",
"react-native": "0.63.2",
"@react-navigation/bottom-tabs": "^5.8.0",
"@react-navigation/native": "^5.7.3",
"@react-navigation/stack": "^5.9.0",

Navigation:

const NativeStack = createNativeStackNavigator()

const LoginStack = () => {
  return (
    <NativeStack.Navigator>
      <NativeStack.Screen 
        name={'Login'} 
        component={LoginScreen}
        options={{
          headerLeft: () => <Text>Left</Text>,
          headerCenter: () => <Text>Center</Text>,
          headerRight: () => <Text>Right</Text>
        }}
      />
    </NativeStack.Navigator>
  )
}

Note: I have enabledScreens() in my app.js file per the documentation.

Any information regarding this would be greatly appreciated! I'm happy to try any suggestions as well.

Thank you!

@ryanmcgough
Copy link
Author

After more research, I found this situation has already been mentioned and solver per #600

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant