JSFiddle - React, Tailwind, and code Playground

by doug65536

JavaScript

$(function() {
    window.onpopstate = function(event) {
        console.log('got popstate ', event, 'args', arguments);
        if (event.state !== null) {
            console.log(event.state.foo);
        }
    };

    debugger;
    history.pushState({foo:"You never get this one"}, "", "#dummy");
    history.pushState({foo:"1"}, "", "#dummy");
    debugger;
});