React Cannot read property ‘push’ of undefined 解决方法

1、最近自学react,做一个小系统,点击登出按钮报

image.png

2、一查资料,发现是需要从父组件把history传下来

代码为

history={this.props.history}

image.png

3、效果出来了

image.png

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享