-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
fix(react): IonNav apply properties to page components #25603
Merged
Merged
Changes from 9 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e637993
fix(react): IonNav rootParams apply to root component
sean-perkins e47487e
test(react): IonNav rootParams
sean-perkins 7b3751f
fix(): dev warning if using rootParams
sean-perkins 882cf2a
test(): update test description
sean-perkins 5d82c05
fix(react): improve IonNav with hmr
sean-perkins 926fa9e
chore(): lint fixes
sean-perkins d0ed1de
Merge branch 'main' into FW-1839
sean-perkins 9757b37
fix(): rootParams and componentProps work with IonNav
sean-perkins 7be2d80
Merge branch 'main' into FW-1839
sean-perkins 041de9e
fix(react): can assign ref to IonNav (#25653)
sean-perkins 116491c
Merge branch 'main' into FW-1839
sean-perkins 93a1ed7
Merge branch 'main' into FW-1839
sean-perkins e8eabf1
Merge branch 'main' into FW-1839
sean-perkins 9d97bff
Merge branch 'main' into FW-1839
liamdebeasi 85220d2
Merge branch 'main' into FW-1839
sean-perkins d9bfdfa
Merge branch 'main' into FW-1839
sean-perkins 787fdfe
Merge branch 'main' into FW-1839
sean-perkins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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 the map?
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.
One instance of the delegate is constructed for one instance of
IonNav
, butIonNav
can attach multiple views to the DOM.The map allows us to keep track of all instances of the individual views that were pushed inside the Nav. We can then do a look-up against the map to find the correct instance to remove the view from the DOM.
In the previous implementation, the value of
Component
would be reset when a new view was pushed, which prevented the previous view from ever being removed.Alternatively you could use an object instead of a map here, but since we are associating to a React component, a
WeakMap
would be my recommendation here so that it does not interfere with garbage collection.