How to return a promise from an action using thunk and useDispatch (react-redux hooks)?
问题 I just started exploring react-redux hooks and I was curious how to return a promise if I am using thunk and useDispatch() . Essentially I want to achieve the following: const dispatch = useDispatch(); dispatch(myAction(...args)).then((result) => { ...do something with result }); When my action looks like this: const myAction = (arg1, arg2) => { return (dispatch, getState) => { Promise.resolve(arg1 + arg2); } } I've simplified my problem a lot, but that is essentially what I'm dealing with.