svelte-navigator icon indicating copy to clipboard operation
svelte-navigator copied to clipboard

parameters with Route

Open norricorp opened this issue 2 years ago • 1 comments

The docs show how to do the above. <Route path="blog/:id" let:params> <BlogPost id="{params.id}" /> </Route>

So my code is <Route path="/resetpw:token" let:params> <ResetPW token="{params.token}" /> </Route>

In a browser, if I try to http://localhost:3000/resetpw then that page is not found. And equally if I use http://localhost:3000/resetpw?token=ewudheiuhdeuih then same result.

So two questions. Any ideas what I am doing wrong? If Route has a parameter, does that parameter have to be present to be picked up by Route?

Regards, John

norricorp avatar Mar 20 '23 08:03 norricorp

So I have just realised that I actually need http://localhost:3000/resetpw/ewudheiuhdeuih. Which is a bit of an issue because the url will be delivered with params.

norricorp avatar Mar 20 '23 16:03 norricorp