this.props.history.goBack() 返回上一个界面问题 ?
来源:5-23 集成react-router

宝慕林3443678
2018-09-20
this.props.history.goBack() 返回上一个界面问题 ,上一个界面会重新走constructor、componentDidMount 方法 ,因为我在componentDidMount里有进行网络加载请求,怎样让他返回时不走constructor、componentDidMount 方法?
写回答
1回答
-
吕小鸣
2018-09-21
你好,这种情况你可以在store里加一个标志位用来区分判断,在goback前激活一下标志位,在请求数据前如果有就不在请求数据了。
00
相似问题