@@ -43,7 +43,9 @@ describe('React', () => {
43
43
children : ReactNode
44
44
reducers : ReducersType
45
45
}
46
-
46
+ interface ReduxContextType extends ReactReduxContextValue {
47
+ storeState ?: any
48
+ }
47
49
function ExtraReducersProvider ( {
48
50
children,
49
51
reducers,
@@ -53,13 +55,9 @@ describe('React', () => {
53
55
{ ( injectReducers ) => (
54
56
< ReactReduxContext . Consumer >
55
57
{ ( reduxContext ) => {
56
- interface ReduxContextType extends ReactReduxContextValue {
57
- storeState ?: any
58
- }
59
- const latestState =
60
- reduxContext && reduxContext . store . getState ( )
61
- const contextState =
62
- reduxContext && ( reduxContext as ReduxContextType ) . storeState
58
+ const latestState = reduxContext ! . store . getState ( )
59
+ const contextState = ( reduxContext as ReduxContextType )
60
+ . storeState
63
61
64
62
let shouldInject = false
65
63
let shouldPatch = false
@@ -80,7 +78,7 @@ describe('React', () => {
80
78
}
81
79
82
80
if ( shouldInject ) {
83
- injectReducers && injectReducers ( reducers )
81
+ injectReducers ! ( reducers )
84
82
}
85
83
86
84
if ( shouldPatch && reduxContext ) {
@@ -89,7 +87,7 @@ describe('React', () => {
89
87
// this would better avoid tearing in a future concurrent world
90
88
const patchedReduxContext = {
91
89
...reduxContext ,
92
- storeState : reduxContext && reduxContext . store . getState ( ) ,
90
+ storeState : reduxContext ! . store . getState ( ) ,
93
91
}
94
92
return (
95
93
< ReactReduxContext . Provider value = { patchedReduxContext } >
0 commit comments