import {useNavigate} from 'react-router-dom' export default function Demo() { const navigate = useNavigate() const handle = () => { //第一種使用方式:指定具體的路徑 navigate('/login', { replace: false, state: {a:1, b:2} }) //第二種使用方式:傳入數(shù)值進行前進或后退,類似于5.x中...
www.dbjr.com.cn/article/2654...htm 2025-6-5