ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

fix(react): nav will remove components from the DOM

Open sean-perkins opened this issue 1 year ago • 0 comments

Pull request checklist

Please check if your PR fulfills the following requirements:

  • [x] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been reviewed and added / updated if needed (for bug fixes / features)
    • Some docs updates need to be made in the ionic-docs repo, in a separate PR. See the contributing guide for details.
  • [x] Build (npm run build) was run locally and any changes were pushed
  • [x] Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • [x] Bugfix
  • [ ] Feature
  • [ ] Code style update (formatting, renaming)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] Documentation content changes
  • [ ] Other (please describe):

What is the current behavior?

When IonNav performs a pop operation (navigating to root, back, etc.) the views are not removed from the DOM.

Issue URL: #25753

What is the new behavior?

  • IonNav removes pages from the DOM when they are popped (navigate back, navigate to root, etc.)
  • Memoized constructing React delegate (was reconstructing on each render)

Does this introduce a breaking change?

  • [ ] Yes
  • [x] No

Other information

Dev-build: 6.2.3-dev.11660655396.10551559

sean-perkins avatar Aug 16 '22 13:08 sean-perkins