react hooks中使用路由跳转

940 阅读1分钟
import {useHistory} from 'react-router-dom'

const component = () => {
    const history = useHistory();
    history.push('path');
}