This is the last part of this Blog mock-up project. Today we learn how to do redirects after we add a new blog and how to delete the blogs as well.
Start it up like this:
npx json-server — watch data/data.json — port 8000
npm start or yarn start
So we start with redirecting. We will be using a hook called “useHistory.”
That allows us to go back and forth in history, and it also allows us to redirect people after submitting: