diff --git a/src/components/Provider.tsx b/src/components/Provider.tsx index a85bb7fd6..8a95454c7 100644 --- a/src/components/Provider.tsx +++ b/src/components/Provider.tsx @@ -15,7 +15,7 @@ export interface ProviderProps { * If this is used, you'll need to customize `connect` by supplying the same context provided to the Provider. * Initial value doesn't matter, as it is overwritten with the internal state of Provider. */ - context?: Context + context?: Context children: ReactNode } diff --git a/src/components/connect.tsx b/src/components/connect.tsx index 9d2dc829e..7ef301529 100644 --- a/src/components/connect.tsx +++ b/src/components/connect.tsx @@ -425,9 +425,9 @@ function connect< TMergedProps = {}, State = DefaultRootState >( - mapStateToProps: MapStateToPropsParam, - mapDispatchToProps: MapDispatchToPropsParam, - mergeProps: MergeProps, + mapStateToProps?: MapStateToPropsParam, + mapDispatchToProps?: MapDispatchToPropsParam, + mergeProps?: MergeProps, options?: ConnectOptions ): InferableComponentEnhancerWithProps diff --git a/test/components/connect.spec.tsx b/test/components/connect.spec.tsx index 9de7d7725..6bad24a28 100644 --- a/test/components/connect.spec.tsx +++ b/test/components/connect.spec.tsx @@ -2154,10 +2154,9 @@ describe('React', () => { } } - const context = React.createContext | null>(null) + const context = React.createContext< + ReactReduxContextValue + >(null as any) let actualState @@ -2196,10 +2195,9 @@ describe('React', () => { } } - const context = React.createContext | null>(null) + const context = React.createContext< + ReactReduxContextValue + >(null as any) let actualState @@ -2451,8 +2449,9 @@ describe('React', () => { (state: RootStateType = 0, action: ActionType) => action.type === 'INC' ? state + 1 : state ) - const customContext = - React.createContext(null) + const customContext = React.createContext( + null as any + ) class A extends Component { render() {