pshrmn / curi

A JavaScript router for single-page applications
https://curi.js.org
MIT License
269 stars 10 forks source link

How do I change route programmatically #233

Closed timsayshey closed 4 years ago

timsayshey commented 4 years ago

Might seem obvious but after reading all the docs I can't find a way to change the route via Javascript.

Help appreciated :)

timsayshey commented 4 years ago

I found the navigate method but it doesn't look like you can pass a route name. You have to pass the url which is unfortunate since I will only have the route name and params available. Is there a way to work with these?

pshrmn commented 4 years ago

You can use router.url to generate a url string.