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'
22
33import { useReduxContext as useDefaultReduxContext } from './useReduxContext'
44import { ReactReduxContext } from '../components/Context'
5- import type { EqualityFn } from '../types'
5+ import type { EqualityFn , NoInfer } from '../types'
66import type { uSESWS } from '../utils/useSyncExternalStore'
77import { notInitialized } from '../utils/useSyncExternalStore'
88
@@ -32,7 +32,7 @@ export function createSelectorHook(
3232
3333 return function useSelector < TState , Selected extends unknown > (
3434 selector : ( state : TState ) => Selected ,
35- equalityFn : EqualityFn < Selected > = refEquality
35+ equalityFn : EqualityFn < NoInfer < Selected > > = refEquality
3636 ) : Selected {
3737 if ( process . env . NODE_ENV !== 'production' ) {
3838 if ( ! selector ) {
Original file line number Diff line number Diff line change @@ -168,3 +168,5 @@ export interface TypedUseSelectorHook<TState> {
168168 equalityFn ?: EqualityFn < TSelected >
169169 ) : TSelected
170170}
171+
172+ export type NoInfer < T > = [ T ] [ T extends any ? 0 : never ]
You can’t perform that action at this time.
0 commit comments