You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tim Wisniewski edited this page Oct 2, 2016
·
2 revisions
How do I change the route from within my application? There has been a lot of conversation around this and the 4.0 release of choo will provide a consistent approach. In the meantime, you can use these methods:
hash routing
If you use hash routing you can change the route by simply using:
window.location.hash='foo'
This will automatically trigger choo's built-in setLocation reducer.
browser history routing (default)
The default routing in choo uses HTML5's browser history API. There's no way for JavaScript to observe when a new state has been pushed via .pushState(), so it's a two-command process.