React Router Dom v6 Goback

import { useNavigate } from "react-router-dom";
const navigate = useNavigate();
navigate(-1);
CodePadding