Skip to content

Commit 084ec1d

Browse files
committed
Fix failing hooks typetest
1 parent 749e1ee commit 084ec1d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/hooks/useSelector.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
import { useCallback, useDebugValue, useRef } from 'react'
1+
import React, { useCallback, useDebugValue, useRef } from 'react'
22

33
import {
44
createReduxContextHook,
55
useReduxContext as useDefaultReduxContext,
66
} from './useReduxContext'
7-
import { ReactReduxContext } from '../components/Context'
7+
import {
8+
ReactReduxContext,
9+
ReactReduxContextValue,
10+
} from '../components/Context'
811
import type { EqualityFn, NoInfer } from '../types'
912
import type { uSESWS } from '../utils/useSyncExternalStore'
1013
import { notInitialized } from '../utils/useSyncExternalStore'
14+
import { Action, UnknownAction } from 'redux'
1115

1216
export type CheckFrequency = 'never' | 'once' | 'always'
1317

@@ -41,7 +45,9 @@ const refEquality: EqualityFn<any> = (a, b) => a === b
4145
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
4246
* @returns {Function} A `useSelector` hook bound to the specified context.
4347
*/
44-
export function createSelectorHook(context = ReactReduxContext): UseSelector {
48+
export function createSelectorHook(
49+
context: React.Context<ReactReduxContextValue<any, any>> = ReactReduxContext
50+
): UseSelector {
4551
const useReduxContext =
4652
context === ReactReduxContext
4753
? useDefaultReduxContext

0 commit comments

Comments
 (0)