route to home page on window reload in React code example
Example 1: react router refresh page
location.reload();
Example 2: react router refresh page
`yarn add react-router` or `npm install react-router`
import { useHistory } from 'react-router'
const history = useHistory()
history.go(0)