Hi! Do you think that would make sense to support relative paths in history.push? So we can do stuff like that:
browserHistory.push('../'); // go to parent
browserHistory.push('../sibling'); // go to sibling
You'll be happy to know that we already do support relative pathnames :)
If you're not seeing this you may be using an older version.
Looks like we are on outdated version.
We use RR 2.5.3 which uses history ^2.0.1 and there's no LocationUtils there. Looks like there's no way we can get this in v2: v2.8.2 uses history 2.1.2.
Thank you!
I have a question related to relative path
When I call browserHistory.push('posts')
path e.g. /user/1 goes to /user/posts
path /user/1/ goes to /user/1/posts
It was unexpected to me at first, but then I supposed it might be the correct behavior
Is there a config to always append a trailing slash? Or a way to go to the deeper level from the first path?
In general what would you recommend?
I'm using universal-router, and currently trailing slash doesn't matter in my routes, so /user/1 and /user/1/ resolve to the same page
Same issue as @quanganhtran
Most helpful comment
I have a question related to relative path
When I call
browserHistory.push('posts')path e.g.
/user/1goes to/user/postspath
/user/1/goes to/user/1/postsIt was unexpected to me at first, but then I supposed it might be the correct behavior
Is there a config to always append a trailing slash? Or a way to go to the deeper level from the first path?
In general what would you recommend?
I'm using universal-router, and currently trailing slash doesn't matter in my routes, so
/user/1and/user/1/resolve to the same page