U
U
ubbe_lodbroke2020-04-16 13:09:48
JavaScript
ubbe_lodbroke, 2020-04-16 13:09:48

How to learn access to state in redux in action?

When I do a dispatch, I use a function where I need access to the global State. Initially, I used a closure and the getState method:
export function addToPreList(name, count){
return (dispatch, getState) => {

}
}

but in this case, for some reason, the props of the component itself was not updated, which received properties by using connect(mapStateToProps)

Is there another way to access the global State?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2020-04-16
@miraage

redux-thunk

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question