[react] this.props 中找不到 history
问题在用React开发时 要通过this.props.history.replace('路径')跳转 ,在this.props却找不到.history 导致无法跳转 。原因由于 React 中,只有在 <Route> 包裹的组件中,才能在 this.props 属性中找到 history 。解决方案第一种 : 直接用<Route> 进行包裹。(直接用,不说了)...
原创
2019-08-06 11:05:39 ·
5413 阅读 ·
0 评论