Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trigger transition to do replaceState rather than pushState

Tags:

react-router

I am building a component that dis displaying a table of data. As they add and remove filters to that data, I would like modify the queryString with replaceState, but as far as I can see there is no method to do that.

Is there a way to tell the transition to use replaceState rather than pushState?

like image 709
Matt Avatar asked Jul 24 '15 20:07

Matt


1 Answers

Specify history on your contextTypes, then call this.context.history.replaceState.

If you're using React.createClass, you can also use the History mixin.

like image 114
taion Avatar answered Nov 10 '22 00:11

taion