# Function createDispatchHook

- createDispatchHook<S, A>(context?): (<AppDispatch>() => AppDispatch)

- Hook factory, which creates a `useDispatch` hook bound to a given context.

  #### Type Parameters

  - S = unknown
  - A extends Action<any> = AnyAction

  #### Parameters

  - `Optional` context: Context<ReactReduxContextValue<S, A>>

    Context passed to your `<Provider>`.

  #### Returns (<AppDispatch>() => AppDispatch)

  A `useDispatch` hook bound to the specified context.

  - - <AppDispatch>(): AppDispatch

    - #### Type Parameters

      - AppDispatch extends Dispatch<A> = Dispatch<A>

      #### Returns AppDispatch

  - Defined in common/temp/node_modules/.pnpm/react-redux@8.1.3_91ee3f21853aee6f4038f22086c31182/node_modules/react-redux/es/hooks/useDispatch.d.ts:10