• Creates a "pre-typed" version of useSelector useSelector where the state type is predefined.

    This allows you to set the state type once, eliminating the need to specify it with every useSelector useSelector call.

    Type Parameters

    • OverrideStateType extends {
          app: AppState;
      }

      The specific type of state this hook operates on.

    Returns UseSelector<OverrideStateType>

    A pre-typed useSelector with the state type already defined.

    Example

    export const useAppSelector = useSelector.withTypes<RootState>()
    

    Since

    9.1.0

Generated using TypeDoc