Aquí está la acción en sí:
import actionFromAnotherReducer from '../subfolder/reducer' export const asyncAction = createAsyncThunk( 'reducerName/actionName', async( data, { dispatch, getState } ) => { return somePromise.then(response => { dispatch(actionFromAnotherReducer(response)) }) } )
Y aquí es donde aparece este error Cannot read properties of undefined (reading 'getState')
: The above error occurred in the <Provider> component
. La cuestión es que cuando elimino el envío (acción), todo funciona, y también si envío una acción desde el mismo reductor de carpetas, también funciona. ¿Como arreglarlo?