React Cannot read property 'push' of undefined 解决方法


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

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

代码为

history={this.props.history}

3、效果出来了

相关