Skip to content

Conversation

@chrisbobbe
Copy link
Contributor

(I plucked this small PR from some work I did while dealing with #5489 but that didn't make it into #5489.)

…etc.)

This way, we can stop using NavigationService in these action
sheets, and instead use `navigation.push` calls. React Navigation
upstream recommends avoiding the NavigationService approach where
possible, and this goes in that direction; see more in zulip#5408.
Further in the direction of zulip#5408, which switched most of our
then-existing uses of NavigationService to use `navigation` instead.

As noted there:

> Switching away from `NavigationService` is recommended by React
> Navigation upstream, as described at zulip#4417. We also now get
> type-checking on those `navigation.push` calls -- Flow is able to
> check that the route params we pass line up with what the route in
> question expects -- which wasn't/isn't the case for the
> implementations of the `navActions` functions.

This causes a few of the navActions functions to lose their last
remaining caller, so delete those.
@chrisbobbe chrisbobbe force-pushed the pr-action-sheets-navigation-object branch from e10c313 to 39c903c Compare November 17, 2022 21:44
Further in the direction of zulip#5408, which switched most of our
then-existing uses of NavigationService to use `navigation` instead.

As noted there:

> Switching away from `NavigationService` is recommended by React
> Navigation upstream, as described at zulip#4417. We also now get
> type-checking on those `navigation.push` calls -- Flow is able to
> check that the route params we pass line up with what the route in
> question expects -- which wasn't/isn't the case for the
> implementations of the `navActions` functions.

This causes a few of the navActions functions to lose their last
remaining caller, so delete those.
@chrisbobbe chrisbobbe force-pushed the pr-action-sheets-navigation-object branch from 39c903c to a622636 Compare November 17, 2022 21:44
@chrisbobbe
Copy link
Contributor Author

Just added two commits that remove NavigationService from src/webview/handleOutboundEvents.js, too.

@gnprice
Copy link
Member

gnprice commented Nov 18, 2022

Thanks for this cleanup! Looks great -- merging.

@gnprice gnprice merged commit a622636 into zulip:main Nov 18, 2022
@chrisbobbe chrisbobbe deleted the pr-action-sheets-navigation-object branch November 18, 2022 23:28
@chrisbobbe
Copy link
Contributor Author

Thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants