File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { useContext, useDebugValue } from 'react'
2
2
3
3
import { useReduxContext as useDefaultReduxContext } from './useReduxContext'
4
4
import { ReactReduxContext } from '../components/Context'
5
- import type { EqualityFn } from '../types'
5
+ import type { EqualityFn , NoInfer } from '../types'
6
6
import type { uSESWS } from '../utils/useSyncExternalStore'
7
7
import { notInitialized } from '../utils/useSyncExternalStore'
8
8
@@ -32,7 +32,7 @@ export function createSelectorHook(
32
32
33
33
return function useSelector < TState , Selected extends unknown > (
34
34
selector : ( state : TState ) => Selected ,
35
- equalityFn : EqualityFn < Selected > = refEquality
35
+ equalityFn : EqualityFn < NoInfer < Selected > > = refEquality
36
36
) : Selected {
37
37
if ( process . env . NODE_ENV !== 'production' ) {
38
38
if ( ! selector ) {
Original file line number Diff line number Diff line change @@ -168,3 +168,5 @@ export interface TypedUseSelectorHook<TState> {
168
168
equalityFn ?: EqualityFn < TSelected >
169
169
) : TSelected
170
170
}
171
+
172
+ export type NoInfer < T > = [ T ] [ T extends any ? 0 : never ]
You can’t perform that action at this time.
0 commit comments