@@ -148,7 +148,7 @@ export function createSelectorHook(
148
148
| EqualityFn < NoInfer < Selected > >
149
149
| UseSelectorOptions < NoInfer < Selected > > = { } ,
150
150
) : Selected => {
151
- const { equalityFn = refEquality , devModeChecks = { } } =
151
+ const { equalityFn = refEquality } =
152
152
typeof equalityFnOrOptions === 'function'
153
153
? { equalityFn : equalityFnOrOptions }
154
154
: equalityFnOrOptions
@@ -166,13 +166,9 @@ export function createSelectorHook(
166
166
}
167
167
}
168
168
169
- const {
170
- store,
171
- subscription,
172
- getServerState,
173
- stabilityCheck,
174
- identityFunctionCheck,
175
- } = useReduxContext ( )
169
+ const reduxContext = useReduxContext ( )
170
+
171
+ const { store, subscription, getServerState } = reduxContext
176
172
177
173
const firstRun = React . useRef ( true )
178
174
@@ -181,6 +177,11 @@ export function createSelectorHook(
181
177
[ selector . name ] ( state : TState ) {
182
178
const selected = selector ( state )
183
179
if ( process . env . NODE_ENV !== 'production' ) {
180
+ const { devModeChecks = { } } =
181
+ typeof equalityFnOrOptions === 'function'
182
+ ? { }
183
+ : equalityFnOrOptions
184
+ const { identityFunctionCheck, stabilityCheck } = reduxContext
184
185
const {
185
186
identityFunctionCheck : finalIdentityFunctionCheck ,
186
187
stabilityCheck : finalStabilityCheck ,
@@ -243,7 +244,7 @@ export function createSelectorHook(
243
244
return selected
244
245
} ,
245
246
} [ selector . name ] ,
246
- [ selector , stabilityCheck , devModeChecks . stabilityCheck ] ,
247
+ [ selector ] ,
247
248
)
248
249
249
250
const selectedState = useSyncExternalStoreWithSelector (
0 commit comments