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

Allow for custom route in pushTo and replaceTo methods #417

Merged
merged 1 commit into from
Dec 17, 2016

Conversation

backflip
Copy link
Contributor

#310 allows us to do things like <Link href='/blog?id=first' as='/blog/first'>. It would be useful to be able to do the same with pushTo (e.g. pushTo('/blog?id=first', '/blog/first') and replaceTo, respectively.

This PR would change both methods to mirror the login of the Link component: https://github.com/zeit/next.js/blob/master/lib/link.js#L29-L30

@coveralls
Copy link

coveralls commented Dec 17, 2016

Coverage Status

Coverage decreased (-0.1%) to 57.024% when pulling cd99b79 on backflip:feature/programmatic-api into b62a0e8 on zeit:master.

@rauchg
Copy link
Member

rauchg commented Dec 17, 2016

Very clever. I'm glad people are using master extensively :D

@rauchg
Copy link
Member

rauchg commented Dec 17, 2016

@nkzawa feel free to merge this provided we document as for both <Link> and the imperative API in the README

@nkzawa
Copy link
Contributor

nkzawa commented Dec 17, 2016

This is something I missed to implement, thanks 😄

@nkzawa nkzawa merged commit de6521a into vercel:master Dec 17, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 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

Successfully merging this pull request may close these issues.

4 participants