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

Query parameters: updating just the query string #2577

Closed
rauschma opened this issue Nov 20, 2015 · 2 comments
Closed

Query parameters: updating just the query string #2577

rauschma opened this issue Nov 20, 2015 · 2 comments

Comments

@rauschma
Copy link

If one keeps most of one’s state in the query string (vs. the path), one usually wants to update just the query string, without touching the path. This is how I did it – does that look OK?

// In my custom onClick handler:
this.context.history.pushState({}, this.context.location.pathname, { someKey: someValue });

// Via a <Link>
<Link to={this.context.location.pathname} query={{selected: ''}}>Clear selected</Link>

Suggestion – mention here: https://github.com/rackt/history/blob/master/docs/QuerySupport.md

@taion
Copy link
Contributor

taion commented Nov 20, 2015

This is being worked on as part of #2186. As mentioned in your issue on history, this is currently being worked on through remix-run/history#141.

@taion taion closed this as completed Nov 20, 2015
@rauschma
Copy link
Author

👍

@lock lock bot locked as resolved and limited conversation to collaborators Jan 22, 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