Skip to content

Commit 7e854c4

Browse files
committed
change ApiProvider context argument to match
1 parent 8b5d210 commit 7e854c4

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

packages/toolkit/src/dynamicMiddleware/tests/react.test.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,7 @@ describe('createReactDynamicMiddleware', () => {
8989
render(<Component />, {
9090
wrapper: ({ children }) => (
9191
<Provider store={store}>
92-
<Provider
93-
context={context as React.Context<ReactReduxContextValue | null>}
94-
store={store2}
95-
>
92+
<Provider context={context} store={store2}>
9693
{children}
9794
</Provider>
9895
</Provider>

packages/toolkit/src/query/react/ApiProvider.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ export function ApiProvider<A extends Api<any, {}, any, any>>(props: {
3636
children: any
3737
api: A
3838
setupListeners?: Parameters<typeof setupListeners>[1] | false
39-
context?: Context<ReactReduxContextValue>
39+
context?: Context<ReactReduxContextValue | null>
4040
}) {
41-
const context = (props.context ||
42-
ReactReduxContext) as Context<ReactReduxContextValue | null>
41+
const context = props.context || ReactReduxContext
4342
const existingContext = useContext(context)
4443
if (existingContext) {
4544
throw new Error(

0 commit comments

Comments
 (0)