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: [],