Lots of turmoil and heated debate in the US surrounding history and who we immortalize in marble and bronze. Fortunately this blog is neither Politico or Fox News and you don’t have to hear me weigh in.

The history that I’m talking about is **drumroll** browser history.

If you’re wondering why it took so long to discover this, I mean, it’s only been out since Chrome version 8 and we’re on version 60 now, that’s like *opens calculator app* 52 versions ago, the short answer is “Adobe Flash”. But now I’m all fancy with React so I get to learn about web things again. YAY!

React is exactly the reason that I now know about window.history. If you’re familiar with React, then you probably know about React Router. React Router uses the history API to modify the path of the URL without reloading the page. And based on the location path, we can decide what components to render for the user. The most important and powerful part of window.history is that the user experience does not change for SPAs (single-page applications). The back and forward browser buttons work normally and going directly to a deeper URL will load the correct page state.

Don’t take it from me though! Here’s what the experts are saying:

I highly recommend buying the FullStack React book brought to you by the same dudes that created React Router. Yes, you can learn about all of the separate pieces of a React application from their respective resources, and they’re very good resources, but it’s nice having a single resource that weaves all of these components together so you can see them in a practical context.

*Note: React Router uses a node module aptly called history. It normalizes the differences between different browser vendors’ history APIs.

Until next time!