bug: ion-router does not work with query params
See original GitHub issueBug Report
Ionic version: 4.9.1
Current behavior: I use ion-router component in stencilJs.
Here is ion-router config:
<ion-router useHash={false}>
<ion-route url="/home" component="app-home-page" />
</ion-router>
I need to open /home page with query params (/home?p=1)
Navigation to /home?p=1 does not work. I tried to navigate using ion-router-link component:
<ion-router-link href={"/home?p=1"}>Home page</a>
and using ion-router component
const nav = document.querySelector('ion-router');
nav.push("/home?p=1")
In both cases there is an error console: route not found. But if I reload the page in browser then page is successfully opened.
Expected behavior:
Navigation to /home?p=1 must work.
Steps to reproduce:
- In stencilJs add ion-router:
<ion-router useHash={false}>
<ion-route url="/home" component="app-home-page" />
</ion-router>
- try to navigate to “/home?p=1”
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7 (1 by maintainers)
Top Results From Across the Web
bug: ion-router does not work with query params · Issue #19707
Bug Report Ionic version: 4.9.1 Current behavior: I use ion-router component in stencilJs. Here is ion-router config: I need to open /home ...
Read more >ionic4 Angular 7 query params subscribe is not triggering on ...
I'm trying to subscribe the query params. But it is not 'console' the changes when ever there is a change. It works in...
Read more >How to Pass Data with Angular Router in Ionic [v4]
Now we can get into the three different solutions we got for our problem. 1. Using Query Params (bad). The first option is...
Read more >ionic/www/29-es2015.js.map ... - GitLab
n *\n * Accepts paths similar to expressjs so that you can define parameters\n * in the url /foo/:bar where bar would be...
Read more >angular - Ionic menu unable to open after navigate to the same page ...
seems like ionic-router-outlet bug (btw about year ago had similar problem with ion-nav, when it makes component with display: none instead deleting it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tricki the issue has been solved in 5.1.1. I just tested it, the querystring gets passed along with the route.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.