1、最近自学react,做一个小系统,点击登出按钮报
2、一查资料,发现是需要从父组件把history传下来
代码为
history={this.props.history}
3、效果出来了
React Cannot read property 'push' of undefined 解决方法
原文:https://www.cnblogs.com/StephenWu5/p/14847273.html