Closed BrandesEric closed 8 years ago
Currently navigate
is just a simple wrapper around pushState/hashchange, so it requires the absolute path to navigate to.
An option would be to create a function generator that can take in the root and pass back a navigate function that will always prepend it. This would still require passing it around in the Component context though I believe.
Any thoughts? If you find a solution that works for you I'll happily review a pull request so others can benefit.
Ah yes, I see what you mean...
For now we just handle all navigates in the same component which is aware of the root, so we can avoid context, but I can see where this gets a little tricky. We're quite happy with it as-is, but if any brilliant ideas strike I will certainly submit a PR :)
Thanks!
I know that when you configure the router component you can pass a
root: "/some/app/root"
value. This is excellent. However,navigate()
doesn't seem to respect this root value. Would this be something you'd consider adding?