Manipulating the browser history


(Tbaatar) #1

Hi,

Our React developer has asked me the question if Matrix can handle HTML5 history pushState and replaceState. You can read more about how it should work here.

Basically, we’re embedding React code into Matrix and the code involves pulling content from history by way of route or slug and therefore we don’t want full page refresh. I’m sure there are other ways around it but if there is the possibility of serving virtual page/slug into Matrix URL it will be great.

Thanks.


(Tbaatar) #2

Anyone? Squiz stuff? I seem to remember many of the dev use React with Matrix?

If the above explanation doesn’t make any sense, here is a article explaning the benefits and how it is achieved without using the old #hash method.


(Bart Banda) #3

Manipulating the URL using the HTML5 API is all done client side with JS, so yes, it’s totally possible to do in Matrix.


(Tbaatar) #4

Hi Bart,

Thanks for the feedback. You are right it can be achieved purely on client side, we eventually managed to get it working. Our JS guys says it was a routing issue within his JS code.

Thanks.
Tuguldur