Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: setState after unmount #7655

Merged
merged 11 commits into from
Feb 9, 2021
2 changes: 1 addition & 1 deletion src/react/hooks/utils/useBaseQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function useBaseQuery<TData = any, TVariables = OperationVariables>(
options: updatedOptions as QueryDataOptions<TData, TVariables>,
context,
onNewData() {
if (!queryData.ssrInitiated()) {
if (!queryData.ssrInitiated() && queryDataRef.current) {
// When new data is received from the `QueryData` object, we want to
// force a re-render to make sure the new data is displayed. We can't
// force that re-render if we're already rendering however so to be
Expand Down