Skip to content

Commit

Permalink
Add fix for contiamo#136
Browse files Browse the repository at this point in the history
  • Loading branch information
ajhenry authored and fabien0102 committed Jul 29, 2019
1 parent 9efe082 commit 3ad53b2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Get.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ class ContextlessGet<TData, TError, TQueryParams> extends React.Component<
this.setState({ loading: false, data: resolved.data, error: resolved.error });
return data;
} catch (e) {
// avoid state updates when component has been unmounted
// and when fetch/processResponse threw an error
if (this.signal.aborted) {
return;
}

this.setState({
loading: false,
error: {
Expand Down

0 comments on commit 3ad53b2

Please sign in to comment.