@@ -2,24 +2,27 @@ import React, { Context, ReactNode, useMemo } from 'react'
22import { ReactReduxContext , ReactReduxContextValue } from './Context'
33import { createSubscription } from '../utils/Subscription'
44import { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect'
5- import type { FixTypeLater } from '../types'
65import { Action , AnyAction , Store } from 'redux'
76
87export interface ProviderProps < A extends Action = AnyAction > {
98 /**
109 * The single Redux store in your application.
1110 */
12- store : Store < FixTypeLater , A >
11+ store : Store < any , A >
1312 /**
1413 * Optional context to be used internally in react-redux. Use React.createContext() to create a context to be used.
1514 * If this is used, you'll need to customize `connect` by supplying the same context provided to the Provider.
1615 * Initial value doesn't matter, as it is overwritten with the internal state of Provider.
1716 */
18- context ?: Context < ReactReduxContextValue >
17+ context ?: Context < ReactReduxContextValue < any , A > >
1918 children : ReactNode
2019}
2120
22- function Provider ( { store, context, children } : ProviderProps ) {
21+ function Provider < A extends Action = AnyAction > ( {
22+ store,
23+ context,
24+ children,
25+ } : ProviderProps < A > ) {
2326 const contextValue = useMemo ( ( ) => {
2427 const subscription = createSubscription ( store )
2528 return {
@@ -46,6 +49,7 @@ function Provider({ store, context, children }: ProviderProps) {
4649
4750 const Context = context || ReactReduxContext
4851
52+ // @ts -ignore 'AnyAction' is assignable to the constraint of type 'A', but 'A' could be instantiated with a different subtype
4953 return < Context . Provider value = { contextValue } > { children } </ Context . Provider >
5054}
5155
0 commit comments