import { useNavigate } from 'react-router-dom';
function GoBackButton() { const navigate = useNavigate();
return <button onClick={() => navigate(-1)}>Назад; }
// In the context of single-page applications, the navigate(-1) method emulates the behavior of the history method.go Back(), which makes it easier to navigate through the browser history.