Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[No QA] [TS migration] Migrate 'withNavigationFallback.js' HOC to TypeScript #30072
[No QA] [TS migration] Migrate 'withNavigationFallback.js' HOC to TypeScript #30072
Changes from all commits
7af7d79
9f79ac3
e06dde2
c0166dd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
This file was deleted.
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.
Why do we need this assertion?
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.
@fabioh8010 Because
NavigationContext.Provider
value is expected to be of typeNavigationProp<ParamListBase>
, but to make our navigationContextValue be of this type, we need to add a lot of methods like navigate, reset, goBack, etc. If you have any ideas on how to improve it, please let me know.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.
I'm trying to understand why do we pass only this values in the first place 🤔. It seems that only
Button
component uses this HOC, could you check what props from this HOC are really being injected in the component?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.
@fabioh8010 Let me provide you with a little bit more context.
This HOC is a workaround for cases when Button/Composer is used outside of the Navigation container.
isFocused
param is used in button,addListener
andremoveListener
are used in Composer.It's the second PR for this file to migrate, that was the first.
In the previous one, we had a suggestion that this HOC isn't necessary anymore and removed it. It caused regressions.
This time I investigated it more careful, and it's not possible to get rid of this HOC, because ErrorBoundary is located outside of the NavigationContainer an has a fallback component GenericErrorPage which has Buttons inside. So without this HOC usage it'll crash.
For more details, see
#24953 (comment)
#24953 (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.
Ok I see, I guess we have no other option then