Explained tutorial is available on my Medium post here
This is a sample application designed to show how you can use state with react-router-dom (Using state with the Browser's history).
We'll be creating an example where we can swap out a value based on state. We're currently just updating a h1
tag based on the state but you could also use this to dynamically swap out a component whilst maintaining DOM history (You can use the DOM History back/forward/refresh and state will be maintained).
This project was bootstrapped with Create React App to simplify your setup process. Run npm install
to install dependencies, then npm start
to view the demo.