Skip to content
On this page

react router获取历史对象

类组件

typescript
const  history = this.props.history

函数式组件

typescript
import { useHistory } from "react-router-dom"
const history = useHistory()

更新时间: