@ionic/react-router 8.8.1-dev.11773432149.19826d0c → 8.8.1-dev.11773665268.1511a6c7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -701,9 +701,15 @@ class ReactRouterViewStack extends ViewStacks {
701
701
  if (existingIsIndexRoute && newIsIndexRoute) {
702
702
  return true;
703
703
  }
704
+ // Reuse empty-path routes (path="") that are not index routes.
705
+ // These function like index routes and should be reused to prevent
706
+ // duplicate views when navigating back to the default path.
707
+ if (existingPath === '' && routePath === '' && !existingIsIndexRoute && !newIsIndexRoute) {
708
+ return true;
709
+ }
704
710
  // Reuse view items with the same path
705
711
  // Special case: reuse tabs/* and other specific wildcard routes
706
- // Don't reuse index routes (empty path) or generic catch-all wildcards (*)
712
+ // Don't reuse generic catch-all wildcards (*)
707
713
  if (existingPath === routePath && existingPath !== '' && existingPath !== '*') {
708
714
  // Parameterized routes need pathname matching to ensure /details/1 and /details/2
709
715
  // get separate view items. For wildcard routes (e.g., user/:userId/*), compare
@@ -1533,7 +1539,7 @@ class StackManager extends React.PureComponent {
1533
1539
  * Handles out-of-scope outlet. Returns true if transition should be aborted.
1534
1540
  */
1535
1541
  handleOutOfScopeOutlet(routeInfo) {
1536
- if (!this.outletMountPath || routeInfo.pathname.startsWith(this.outletMountPath)) {
1542
+ if (!this.outletMountPath || isPathnameInScope(routeInfo.pathname, this.outletMountPath)) {
1537
1543
  return false;
1538
1544
  }
1539
1545
  if (this.outOfScopeUnmountTimeout) {
@@ -2952,7 +2958,7 @@ const IonRouter = ({ children, registerHistoryListener }) => {
2952
2958
  *
2953
2959
  * @param tab The tab to set as active.
2954
2960
  */
2955
- const handleSetCurrentTab = (tab) => {
2961
+ const handleSetCurrentTab = (tab, _routeInfo) => {
2956
2962
  currentTab.current = tab;
2957
2963
  const current = locationHistory.current.current();
2958
2964
  if (!current) {