reactjs阿波罗反应取消请求
我有一个问题,你导航到一个页面,阿波罗检索数据。当apollo执行此操作并导航到另一个页面时,apollo不会取消请求并抛出以下错误:reactjs阿波罗反应取消请求,reactjs,react-apollo,apollo-client,Reactjs,React Apollo,Apollo Client,我有一个问题,你导航到一个页面,阿波罗检索数据。当apollo执行此操作并导航到另一个页面时,apollo不会取消请求并抛出以下错误: Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application 是否有任何方法可以取消或中止来自ComponentDidUnmount的请求 com
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application
是否有任何方法可以取消或中止来自ComponentDidUnmount
的请求
componentDidMount() {
this.props.client.query({ ... })
}
componentWillUnmount() {
// cancel or abort query here
}
谢谢