@@ -54,9 +54,10 @@ interface ReactDynamicMiddlewareInstance<
5454 Dispatch extends ReduxDispatch < UnknownAction > = ReduxDispatch < UnknownAction > ,
5555> extends DynamicMiddlewareInstance < State , Dispatch > {
5656 createDispatchWithMiddlewareHookFactory : (
57- context ?: Context <
58- ReactReduxContextValue < State , ActionFromDispatch < Dispatch > >
59- > ,
57+ context ?: Context < ReactReduxContextValue <
58+ State ,
59+ ActionFromDispatch < Dispatch >
60+ > | null > ,
6061 ) => CreateDispatchWithMiddlewareHook < State , Dispatch >
6162 createDispatchWithMiddlewareHook : CreateDispatchWithMiddlewareHook <
6263 State ,
@@ -71,20 +72,15 @@ export const createDynamicMiddleware = <
7172 const instance = cDM < State , Dispatch > ( )
7273 const createDispatchWithMiddlewareHookFactory = (
7374 // @ts -ignore
74- context : Context <
75- ReactReduxContextValue < State , ActionFromDispatch < Dispatch > >
76- > = ReactReduxContext ,
75+ context : Context < ReactReduxContextValue <
76+ State ,
77+ ActionFromDispatch < Dispatch >
78+ > | null > = ReactReduxContext ,
7779 ) => {
7880 const useDispatch =
79- // @ts -ignore
8081 context === ReactReduxContext
8182 ? useDefaultDispatch
82- : createDispatchHook (
83- context as Context < ReactReduxContextValue <
84- State ,
85- ActionFromDispatch < Dispatch >
86- > | null > ,
87- )
83+ : createDispatchHook ( context )
8884 function createDispatchWithMiddlewareHook <
8985 Middlewares extends Middleware < any , State , Dispatch > [ ] ,
9086 > ( ...middlewares : Middlewares ) {
0 commit comments