How do I reload a page with react-router?

firstly, add react-router as a dependency

`yarn add react-router` or `npm install react-router`

import { useHistory } from 'react-router'

const history = useHistory()

/////then add this to the function that is called for re-rendering

history.go(0)

This causes your page to re-render automatically

Leave a Comment