Skip to content

Commit

Permalink
Fix failing hooks typetest
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Aug 23, 2023
1 parent 749e1ee commit 084ec1d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/hooks/useSelector.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { useCallback, useDebugValue, useRef } from 'react'
import React, { useCallback, useDebugValue, useRef } from 'react'

import {
createReduxContextHook,
useReduxContext as useDefaultReduxContext,
} from './useReduxContext'
import { ReactReduxContext } from '../components/Context'
import {
ReactReduxContext,
ReactReduxContextValue,
} from '../components/Context'
import type { EqualityFn, NoInfer } from '../types'
import type { uSESWS } from '../utils/useSyncExternalStore'
import { notInitialized } from '../utils/useSyncExternalStore'
import { Action, UnknownAction } from 'redux'

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

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

0 comments on commit 084ec1d

Please sign in to comment.