From d6e870f5780ff7d2c2e7f799387f10194eb4a04f Mon Sep 17 00:00:00 2001 From: Mark Erikson Date: Sat, 23 Sep 2023 21:28:40 -0400 Subject: [PATCH] Try working around TS 4.1 mismatch --- packages/toolkit/src/query/core/buildThunks.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/toolkit/src/query/core/buildThunks.ts b/packages/toolkit/src/query/core/buildThunks.ts index adbcae8359..c3dfe5ab0e 100644 --- a/packages/toolkit/src/query/core/buildThunks.ts +++ b/packages/toolkit/src/query/core/buildThunks.ts @@ -254,7 +254,10 @@ export function buildThunks< return } - const newValue = api.endpoints[endpointName].select(args)(getState()) + const newValue = api.endpoints[endpointName].select(args)( + // Work around TS 4.1 mismatch + getState() as RootState + ) const providedTags = calculateProvidedBy( endpointDefinition.providesTags, @@ -275,7 +278,10 @@ export function buildThunks< (dispatch, getState) => { const endpointDefinition = api.endpoints[endpointName] - const currentState = endpointDefinition.select(args)(getState()) + const currentState = endpointDefinition.select(args)( + // Work around TS 4.1 mismatch + getState() as RootState + ) let ret: PatchCollection = { patches: [],