React-router: Change querystring on the url without reloading

Created on 13 Dec 2016  路  1Comment  路  Source: ReactTraining/react-router

Hey,

Not sure if this is the right channel for this, but here it goes..
I want to change the querystring on the URL while performing search (as you type) on my app localhost:3000/#/list?q=foo

I'm using hashHistory and I've tried doing this on my component:

this.context.router.push({
  query: Object.assign({}, this.context.router.location.query, {q: query})
});

Although it updates the URL as intended, it reloads the page twice. Is there any way to avoid reloading? or at least avoid reloading twice?

Thanks

>All comments

This is a bug tracker, not a support system. For usage questions, please use Stack Overflow or Reactiflux. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ArthurRougier picture ArthurRougier  路  3Comments

maier-stefan picture maier-stefan  路  3Comments

davetgreen picture davetgreen  路  3Comments

yormi picture yormi  路  3Comments

nicolashery picture nicolashery  路  3Comments