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

Upgrade react-navigation to v3 #3649

Closed
gnprice opened this issue Oct 15, 2019 · 6 comments · Fixed by #4249
Closed

Upgrade react-navigation to v3 #3649

gnprice opened this issue Oct 15, 2019 · 6 comments · Fixed by #4249
Assignees

Comments

@gnprice
Copy link
Member

gnprice commented Oct 15, 2019

Forking this out from #3573. Probably I should have made separate issues in the first place.

We use react-navigation for navigation in the app. We're on version 2.18.3. There's a new major version out, v3. (We were on v1 until not long ago; getting to v2 was #3573.)

The v3 releases contain various bugfixes, as well as compatibility with newer other software. Issues blocked on this upgrade include #3569, and possibly #2716 and #3566.

There's partial work toward this issue in #3502.

@gnprice
Copy link
Member Author

gnprice commented Oct 28, 2019

Release notes, since we don't already have them linked here:
https://reactnavigation.org/blog/2018/11/17/react-navigation-3.0

Note that installation has gotten a bit more complicated:
https://reactnavigation.org/docs/en/3.x/getting-started.html#installation
Though not much so if on RN v0.60+ -- so if we do this after #3548 it'll be somewhat simpler.

@awasthishubh
Copy link
Contributor

@gnprice I would like to do this. Can I?

@gnprice
Copy link
Member Author

gnprice commented Jan 10, 2020

@awasthishubh I've just assigned you #3700, which you claimed there; let's start with that. 🙂

@Maskedman99
Copy link
Contributor

react-navigation is currently at v5.x and they've changed the package names

    react-navigation -> @react-navigation/native
    react-navigation-stack -> @react-navigation/stack
    react-navigation-tabs -> @react-navigation/bottom-tabs, @react-navigation/material-top-tabs  
    react-navigation-material-bottom-tabs -> @react-navigation/material-bottom-tabs
    react-navigation-drawer -> @react-navigation/drawer

See https://reactnavigation.org/docs/upgrading-from-4.x

@chrisbobbe
Copy link
Contributor

It appears that FlowTyped does have a libdef for this version! So we very likely won't have to use Flowgen for this upgrade.

@chrisbobbe chrisbobbe self-assigned this Sep 2, 2020
@chrisbobbe
Copy link
Contributor

chrisbobbe commented Sep 3, 2020

(Moved a large comment to my PR: #4249 (comment))

chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Sep 4, 2020
In this commit:

- Update react-navigation and its libdef, handle breaking changes in
  code

- Update react-navigation-redux-helpers to keep compatibility;
  handle breaking changes and let it wrap AppNavigator in its
  preferred way

- Add react-navigation-stack and react-navigation-drawer to prepare
  for the requirement in v4 that we depend on these directly. Match
  the versions of these (and that of react-navigation-tabs, which
  we're already depending on) to the versions react-navigation v3
  has for these in its `dependencies` in its `package.json`. Grab a
  compatible libdef for react-navigation-stack.

- Add @react-navigation/core, @react-navigation/native, and
  react-native-gesture-handler to satisfy peer dependencies. Follow
  instructions for some additional setup for
  react-native-gesture-handler in Jest config and `MainActivity.kt`.

- Add a note about a console error that we're getting, which will go
  away in react-navigation v4. It doesn't seem to break any
  functionality.

See more detail on GitHub [TODO: add link here].

Fixes: zulip#3649
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Sep 4, 2020
In this commit:

- Update react-navigation and its libdef, handle breaking changes in
  code

- Update react-navigation-redux-helpers to keep compatibility;
  handle breaking changes and let it wrap AppNavigator in its
  preferred way

- Add react-navigation-stack and react-navigation-drawer to prepare
  for the requirement in v4 that we depend on these directly. Match
  the versions of these (and that of react-navigation-tabs, which
  we're already depending on) to the versions react-navigation v3
  has for these in its `dependencies` in its `package.json`. Grab a
  compatible libdef for react-navigation-stack.

- Add @react-navigation/core, @react-navigation/native, and
  react-native-gesture-handler to satisfy peer dependencies. Follow
  instructions for some additional setup for
  react-native-gesture-handler in Jest config and `MainActivity.kt`.

- Add a note about a console error that we're getting, which will go
  away in react-navigation v4. It doesn't seem to break any
  functionality.

See more detail on GitHub at
zulip#4249 (comment).

Fixes: zulip#3649
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Sep 11, 2020
In this commit:

- Update react-navigation and its libdef, handle breaking changes in
  code

- Update react-navigation-redux-helpers to keep compatibility;
  handle breaking changes and let it wrap AppNavigator in its
  preferred way

- Add react-navigation-stack and react-navigation-drawer to prepare
  for the requirement in v4 that we depend on these directly. Match
  the versions of these (and that of react-navigation-tabs, which
  we're already depending on) to the versions react-navigation v3
  has for these in its `dependencies` in its `package.json`. Grab a
  compatible libdef for react-navigation-stack.

- Add @react-navigation/core, @react-navigation/native, and
  react-native-gesture-handler to satisfy peer dependencies. Follow
  instructions for some additional setup for
  react-native-gesture-handler in Jest config and `MainActivity.kt`.

- Add a note about a console error that we're getting, which will go
  away in react-navigation v4. It doesn't seem to break any
  functionality.

Also, run `yarn yarn-deduplicate && yarn` as prompted by
`tools/test deps`.

See more detail on GitHub at
zulip#4249 (comment).

Fixes: zulip#3649
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants