reactjs apollo реагирует на отмену запроса - PullRequest
0 голосов
/ 23 марта 2020

У меня есть проблема, из-за которой вы переходите на страницу, а apollo получает данные. Пока 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?

componentDidMount() {
    this.props.client.query({ ... })
}
componentWillUnmount() {
    // cancel or abort query here
}

Спасибо!

...