Skip to content

feat(router): support catch-all routes in ion-route - #31611

Open
ShaneK wants to merge 1 commit into
feature-9.1from
FW-6969
Open

ShaneK wants to merge 1 commit into
feature-9.1from
FW-6969

Conversation

@ShaneK

@ShaneK ShaneK commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Issue number: resolves #24726


What is the current behavior?

Currently, ion-router can't match an unknown path, so there's no way to render a "not found" page. A * in an ion-route url is matched literally, url="/:any" only catches a single segment, and an unknown path below a known route (e.g., /admin/settings) renders that route.

What is the new behavior?

An ion-route url that ends in * now matches any remaining path, and the matched part is passed to the component as pathMatch. Ranking follows React Router, so a catch-all only beats a route that matches the whole path when it has more fixed segments (/admin/* beats /:section/:id but not /admin/:id). It always beats a route that only matches by ignoring trailing segments. Apps without a * route match exactly as before.

Does this introduce a breaking change?

  • Yes
  • No

Not a breaking change, but a new feature, which is why it's in a feature branch.

Other information

This only affects vanilla JS and Stencil apps, since Angular, React and Vue use their own routers. The * in ion-route-redirect is unchanged, so from="/admin/*" still doesn't match /admin while url="/admin/*" does. The docs call out that difference (after the docs PR is merged).

Catch-all test page

Latest dev build

9.0.7-dev.11792524803.14f0e7d2

@ShaneK
ShaneK requested a review from a team as a code owner October 20, 2026 19:25
@ShaneK
ShaneK requested a review from brandyscarney October 20, 2026 19:25
@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-framework Ready Ready Preview Oct 20, 2026 7:26pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — 4f0e7d28 Deployed Oct 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant