antd页面报错TypeError: Cannot read property ‘push‘ of undefined

使用antd,在遍历跳转的url时报错如图

import {withRouter} from 'react-router-dom'
...
...

export default withRouter(Index);

使用withRouter圆满解决

猜你喜欢

转载自blog.csdn.net/chendongpu/article/details/112133130