-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose routeTo #259
Comments
It's exposed already: import { route } from 'preact-router';
route('/page-2') // appends a history entry
route('/page-3', true) // replaces the current history entry Let me know if the docs didn't make this obvious :) |
I am asking for 'routeto' not 'route'. Purpose being that i dont want the url in addressbar to change :) |
@psabharwal123 if the pull request for #265 be applied you will able to extend the preact Router class and do what you want to do :) |
thanks! hopefully someone can review and merge it soon :) |
@studentIvan please have a look at your changes, one of them breaks minification so cant be merged |
I made a PR for this (#270) to get it added to the docs |
Thanks but original request was to expose 'routeTo' |
@psabharwal123 if you want to route without changing the URL, use createMemoryHistory from history. |
routeTo function would be helpful if one needs to "forward" instead of "redirect", basically not change the url in the address bar. example use case - default component forwards to /error/404
The text was updated successfully, but these errors were encountered: