For redux itself, you can only dispatch action which is a plain JS object(or an action creator returns an action, this action is a plain JS object must have a type field.). But with various middlewares, you can dispatch various things such as a thunk, plain JS object action, etc. The middleware will transform the action to plain JS object action in the end.

When using the redux-thunk middleware, you can dispatch a thunk like this:

const thunkFunction = (dispatch, getState) => {
  // logic here that can dispatch actions or read state
}

store.dispatch(thunkFunction)

The login thunk action creator does return a thunk.

A thunk action creator is a function that may have some arguments, and returns a new thunk function. See Writing Thunks

Another example, redux-promise-middleware,

Given a single action with an async payload, the middleware transforms the action to separate pending action and a separate fulfilled/rejected action, representing the states of the async action.

You can dispatch an action with async payload:

const response = dispatch({
    type: 'FIRST',
    payload: new Promise(...),
});
Answer from Lin Du on Stack Overflow
🌐
React Redux
react-redux.js.org › hooks
Hooks | React Redux
February 11, 2026 - This hook returns a reference to the same Redux store that was passed in to the <Provider> component. This hook should probably not be used frequently. Prefer useSelector() as your primary choice.
🌐
GeeksforGeeks
geeksforgeeks.org › reactjs › react-redux-hooks-useselector-and-usedispatch
React Redux Hooks: useSelector and useDispatch. - GeeksforGeeks
July 23, 2025 - It returns a reference to the dispatch function from the Redux store, enabling components to trigger state changes. Here's how to use useDispatch: Import the useDispatch hook from the 'react-redux' library.
🌐
Stack Overflow
stackoverflow.com › questions › 62579569 › is-there-a-way-to-use-react-redux-usedispatch-in-react-using-class-based-compo
Is there a way to use react-redux (useDispatch) in react using class based components? I am using useDispatch inside render function
June 25, 2020 - Yes, there are ways of using react-redux inside class based components. Using connect API provided by react-redux library which will inject the action creators into the class component. Eventually accessing the required dispatch function by this.props.
🌐
Medium
medium.com › @mendes.develop › introduction-on-react-redux-using-hooks-useselector-usedispatch-ef843f1c2561
Introduction on React-Redux using Hooks ( useSelector & useDispatch ) | by Alex Mendes | Medium
November 25, 2019 - Let’s start by importing useSelector from the react-redux library. useSelector is a function that takes the current state as an argument and returns whatever data you want from it.
🌐
ScriptVerse
scriptverse.academy › tutorials › reactjs-useselector-usedispatch.html
React Redux w/with Hooks: How to use useSelector(), useDispatch()
// selectAndDispatch.js import React, { useEffect } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { fetchDogImage } from './redux/actions/dog'; import { fetchQuote } from './redux/actions/quote'; const App = () => { const dogData = useSelector(state => state.dog); const quoteData = useSelector(state => state.quote); const dispatch = useDispatch(); useEffect(() => { dispatch(fetchDogImage()); dispatch(fetchQuote()); console.log('quoteData', quoteData); }, []); return ( <div> <img src={dogData.url} alt='dog'/> <p>{quoteData.quote}</p> <p>- {quoteData.role}</p> </div> ); } export default App;
🌐
egghead.io
egghead.io › lessons › react-dispatch-actions-with-the-usedispatch-hook-in-redux
Dispatch Actions with the useDispatch Hook in Redux | egghead.io
Our app is currently updating both ... avoid this indirection. useDispatch() takes no arguments and simply returns a dispatch function which can be used to fire actions into your reducers....
Published   January 4, 2021
Find elsewhere
🌐
GitHub
github.com › reduxjs › react-redux › blob › master › src › hooks › useDispatch.ts
react-redux/src/hooks/useDispatch.ts at master · reduxjs/react-redux
context === ReactReduxContext ? useDefaultStore : createStoreHook(context) · const useDispatch = () => { const store = useStore() return store.dispatch · } · Object.assign(useDispatch, { withTypes: () => useDispatch, }) · return useDispatch as UseDispatch<Dispatch<ActionType>> } · /** * A hook to access the redux `dispatch` function.
Author   reduxjs
🌐
Tabnine
tabnine.com › home page › code › javascript › react-redux
react-redux.useDispatch JavaScript and Node.js code examples | Tabnine
export default function useActions(actions, deps) { const dispatch = useDispatch(); return useMemo( () => { if(Array.isArray(actions)) { return actions.map(a => bindActionCreators(a, dispatch)); } return bindActionCreators(actions, dispatch); }, deps ? [dispatch, ...deps] : deps ); } ... React.memo(function UserItem({ name, id }) { useRenderTracking(`UserItem: ${name}`); const dispatch = useDispatch(); const onRemove = () => { dispatch(setUserRemoving()); Api.removeUser({ name, id }) .then(() => dispatch(setUserRemoved({ name, id }))) .catch(() => dispatch(setUserRemoveError())); }; return <ListItem onRemove={onRemove}>{name}</ListItem>; })
🌐
Scaler
scaler.com › home › topics › react › hooks in redux : useselector and usedispatch
Hooks in Redux useSelector and useDispatch - React
June 22, 2024 - ... However, we have not changed ... useDispatch is yet another hook in redux which is equivalent to the mapDispatchToProps argument in the connect() higher-order function....
🌐
Alma Better
almabetter.com › bytes › tutorials › reactjs › hooks-in-redux
React Redux Hooks: useSelector and useDispatch
October 18, 2023 - In conclusion, the use of React ... useSelector hook allows access to the state stored in a Redux store, while the useDispatch hook enables dispatching of actions to the store....
🌐
Medium
medium.com › @kemaltf_ › redux-toolkit-dispatching-actions-with-usedispatch-in-react-redux-a-simple-guide-71883f11ac8f
Redux Toolkit — Dispatching Actions with useDispatch in React Redux: A Simple Guide | by Taufik Kemal | Medium
January 28, 2024 - In this tutorial, we’ll explore the useDispatch hook, a crucial tool for dispatching actions with React Redux. This hook provides a straightforward way to interact with the Redux store and trigger actions.
🌐
Memberstack
memberstack.com › home › blog › product › using react redux hooks: useselector() and usedispatch()
Using React Redux Hooks: useSelector() and useDispatch() | Memberstack
June 3, 2022 - mapStateToProps: Whenever there are updates to the state of the Redux store, it receives the entire state and returns an object of data needed by your component. mapDispatchToProps: It can be a function or an object. As a function, it receives dispatch as an argument and returns an object of functions that dispatch actions. As an object, it contains action creators that turn to props that automatically dispatch actions when called. With the advent of hooks, the React team created useSelector, useDispatch, and other custom hooks that make it easier to work with React-Redux and replace the connect() API.
🌐
GitConnected
levelup.gitconnected.com › react-redux-hooks-useselector-and-usedispatch-f7d8c7f75cdd
React-Redux Hooks: useSelector and useDispatch | by Reinald Reynoso | Level Up Coding
April 14, 2022 - This guide will cover how to implement the React-Redux Hooks, useSelector and useDispatch, in your application.
🌐
Blogger
javarevisited.blogspot.com › 2021 › 09 › usedispatch-and-use.html
How to use useDispatch and useSelector? React Hooks Example Tutorial
It has two optional arguments, mapStateToProps and mapDispatchToProps, and these two arguments are used to work with the redux. But they are complicated and require a lot of effort to understand. Now, react provides a better alternative to the connect() method and its arguments. The useDispatch and useSelector hooks are alternatives to mapDispatchToProps and mapStateToProps, respectively.
🌐
DhiWise
dhiwise.com › post › react-usedispatch-hook-explained-optimizing-component-performance
React useDispatch Hook and Beyond: Optimize React-Redux Performance
September 5, 2024 - It allows for a cleaner and more ... optimization, let's understand what useDispatch does. It's a React hook that provides access to the Redux store's dispatch function....
🌐
DEV Community
dev.to › bangash1996 › introduction-react-redux-using-hooks-useselector-usedispatch-26ch
Introduction React-Redux using Hooks (useSelector && useDispatch) - DEV Community
June 5, 2021 - We will invoke useDispatch and store it to a variable, dispatch. This hook returns a reference to the dispatch function from the Redux store. You may use it to dispatch actions as needed.