react新增的hooks中useHistory 的使用方法

react 新增hooks的useHistory 在跳转路由中报错
useHistory在使用中需要下载依赖包么
想知道解决办法

img

你这个需要引入吧。
import { useHistory } from "react-router-dom";