Interface TypedUseSelectorHook<TState>

This interface allows you to easily create a hook that is properly typed for your store's root state.

Example

interface RootState {
property: string;
}

const useTypedSelector: TypedUseSelectorHook<RootState> = useSelector;
interface TypedUseSelectorHook<TState> {
    <TSelected>(selector, equalityFn?): TSelected;
    <Selected>(selector, options?): Selected;
}

Type Parameters

  • TState
  • Type Parameters

    • TSelected

    Parameters

    Returns TSelected

  • Type Parameters

    • Selected = unknown

    Parameters

    Returns Selected