Penggunaan Sejarah tidak diekspor dari reaksi-router-dom
In react-router-dom V6 useHistory() is replaced by useNavigate()
you can use:
import {useNavigate} from 'react-router-dom';
const navigate = useNavigate();
navigate('/home');
KostasX