Answer the question
In order to leave comments, you need to log in
How to call one action in another action using redux-thunk?
It is necessary to call an action inside another action, but the call does not go through at all.
Tell me why it is not called and how to do it correctly?
actionsA.js
export const actionFromA = data => (dispatch) => { }
actionsB.js
import {actionFromA} from '****';
export const actionFromA = data => async (dispatch) => {
// Вот тут нужно вызвать импортированный action
actionFromA();
}
Answer the question
In order to leave comments, you need to log in
export const actionFromA = data => async (dispatch) => {
dispatch(actionFromA());
}
store.dispatch({ /* объект возвращаемый actionFromA */ });
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question