react-router v6에서 useHistory를 사용하니까 아래와 같은 오류가 발생했다.
찾아보니 react-router v6에서는 useHistory가 useNavigate로 변경되었다고한다.
아래와 같이 사용할 수 있다.
const history = useHistory();
history.push('/');
history.replace('/');
// v6
const navigate = useNavigate();
navigate('/');
navigate('/', {replace: true});