-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Strongly type navigationRef, update navigate() utility args type #2424
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
Conversation
frankcalise
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! This will be a better experience out of the box for those toggling strict mode too. Probably some more work to be done for that but a great start
| const [isRestored, setIsRestored] = useState(initNavState) | ||
|
|
||
| const routeNameRef = useRef<string | undefined>() | ||
| const routeNameRef = useRef<keyof AppStackParamList | undefined>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there were other navigators involved would you union those param lists here as well? For example the ones from the Demo Navigator in the case of the demo boilerplate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we'd want to include that here, since we are referencing the root navigator being passed around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we document that then so it could incorporate future nested Stacks etc as params here for the user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed up a commit to add some comments to this: dbce8f4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frankcalise you good with the comment on this? Then I'll be good to merge
dbce8f4 to
18032cd
Compare
|
Yeah let's merge this, skip ci and combine with the generator enhancement.
(Or vice versa)
Holding off on maestro as the fav podcast flow has a hiccup on android
…On Tue, Apr 25, 2023, 18:29 Joshua Yoes ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In boilerplate/app/navigators/navigationUtilities.ts
<#2424 (comment)>:
> const isMounted = useIsMounted()
const initNavState = navigationRestoredDefaultState(Config.persistNavigation)
const [isRestored, setIsRestored] = useState(initNavState)
- const routeNameRef = useRef<string | undefined>()
+ const routeNameRef = useRef<keyof AppStackParamList | undefined>()
@frankcalise <https://github.com/frankcalise> you good with the comment
on this? Then I'll be good to merge
—
Reply to this email directly, view it on GitHub
<#2424 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC3KBXGTHXWSWVTANWS7MTXDBF5FANCNFSM6AAAAAAXHMD27Y>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
🎉 This PR is included in version 8.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Please verify the following:
yarn testjest tests pass with new tests, if relevantREADME.mdhas been updated with your changes, if relevantDescribe your PR
This PR strongly types our
navigationRefwith our actual app stack types, and updates thenavigateutility function to have the correct type.This also addresses the typescript 5.1 error described in this PR: #2393
Additionally, this PR also removes explicit
anytype usages for Ignite 🥳