Skip to main content

# useAppDispatch()

    function useAppDispatch(): AppDispatch;

React hook to get the typed dispatch function. Provides type-safe dispatching of Redux actions.

## Returns​

`AppDispatch`

Typed Redux dispatch function

## Example​

    function MyComponent() {
      const dispatch = useAppDispatch();

      const handleClick = () => {
        dispatch(myAction());
      };

      return <button onClick={handleClick}>Click me</button>;
    }