Skip to content
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

pushState method works with full URLs only #4119

Closed
ybelenko opened this issue Oct 30, 2016 · 1 comment
Closed

pushState method works with full URLs only #4119

ybelenko opened this issue Oct 30, 2016 · 1 comment

Comments

@ybelenko
Copy link

I'm dissapointed with pushState method right now. It says that I can use full urls only.
Let's imagine I have multistep form and I have routes

<Route path="/" component={ App }
    <Route path="companies" companent={ CompanyPage }>
        <Route path="feedback/:stepName" component={ MultiStepForm } />
    </Route>
    <Route path="staff" component={ StaffPage }>
        <Route path="feedback/:stepName" component={ MultiStepForm } />
    </Route>
</Route>

In this scenario when user clicks "continue" button in the form I need to change url from .../feedback/step_one to .../feedback/step_two, but I don't know in which route(companies or staff) user is located.
It would be very convenient to change last part of the url by calling pushState(null, "step_two") instead of parsing and replacing current url manually. If I understand correct, main goal of react-router is to avoid manual URL parsing, so there should be way to change URL partially.

@timdorr
Copy link
Member

timdorr commented Oct 31, 2016

Dupe of #2172

@timdorr timdorr closed this as completed Oct 31, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants