diff --git a/src/react/data/QueryData.ts b/src/react/data/QueryData.ts index 276339b49f0..ca20873c5b2 100644 --- a/src/react/data/QueryData.ts +++ b/src/react/data/QueryData.ts @@ -484,6 +484,9 @@ export class QueryData extends OperationData { private removeObservable(andDelete: boolean) { if (this.currentObservable) { this.currentObservable["tearDownQuery"](); + // this.currentObservable.options.context is deleted in tearDownQuery(), + // so we also delete the context from this.previous.observableQueryOptions + delete this.previous.observableQueryOptions.context; if (andDelete) { delete this.currentObservable; }