Użyterze nie jest eksportowane z reakt-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