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

feat: warn when using native-stack from rns in v6 #1058

Merged
merged 2 commits into from
Aug 19, 2021

Conversation

kacperkapusciak
Copy link
Member

Description

Since react-navigation v6 @react-navigation/native-stack is the preferred way of using native-stack. Nevertheless, nothing stops developers from using react-native-screens/native-stack with RNv6. This PR adds a check if react-native-screens' native-stack is used with RNv6 and warns about this.

Screenshots / GIFs

Simulator Screen Shot - iPhone 11 - 2021-08-18 at 17 12 17

Test code and steps to reproduce

Bump @react-navigation/native in TestsExample to use v6.

Checklist

  • Ensured that CI passes

Copy link
Member

@WoLewicki WoLewicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, left some comments about the text.

@kacperkapusciak kacperkapusciak merged commit 047b01d into master Aug 19, 2021
@kacperkapusciak kacperkapusciak deleted the @kacperkapusciak/warn-native-stack-use-in-v6 branch August 19, 2021 09:25
@kneza23
Copy link

kneza23 commented Aug 24, 2021

it seems that @react-navigation/native-stack and react-native-screens/native-stack are not 1:1. First difference is, one has headerTitle another has headerCenter. And modals with formSheet are not behaving the same. When i changed imports to @react-navigation/native-stack multiple of my screens started to behave differently.

@kneza23
Copy link

kneza23 commented Aug 24, 2021

It broke my app, and i had to change it back to react-native-screens/native-stack from "react-native-screens": "^3.6.0",

@kacperkapusciak
Copy link
Member Author

Hi @kneza23,
there are some breaking changes between versions and in a long run using react-native-screens/native-stack with React Navigation v6 isn't feasible. Please consult the Native Stack Navigator part of the upgrade guide from React Navigation documentation.

Cheers

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

Successfully merging this pull request may close these issues.

4 participants