1import { useHistory } from 'react-router-dom';
2
3function app() {
4 let history = useHistory();
5
6 const redirect = () => {
7 history.push('/your-path')
8 }
9
10 return (
11 <div>
12 <button onClick={redirect}>Redirect</button>
13 </div>
14 )
15}
16