注意当前router版本,只有v6才有useNavigate
v6以下请使用useHistory!
(其实它俩用法很相似的)
const history = useHistory()
history.push(`/student/detail/${id}`)
const navigate = useNavigate()
navigate(`/student/detail/${id}`)
注意当前router版本,只有v6才有useNavigate
v6以下请使用useHistory!
(其实它俩用法很相似的)
const history = useHistory()
history.push(`/student/detail/${id}`)
const navigate = useNavigate()
navigate(`/student/detail/${id}`)