Answer the question
In order to leave comments, you need to log in
Throwing functions from actions through the component tree vs connect functions in a component?
It is interesting to know how this is implemented in your project and why in the context of React / Redux
Answer the question
In order to leave comments, you need to log in
Good afternoon.
Everywhere I use connect. Why? Because "throwing through a tree" - I did not see it in the original documentation, and also did not see it at all. Do you mean using context?
I like connect, everything suits.
In the entry for connect (more specifically for mapDispatchToProps ), I use or don't use bindActionCreators:
const mapDispatchToProps = (dispatch) => ({
pollActions: bindActionCreators(PollActions, dispatch),
})
const mapDispatchToProps = (dispatch) => ({
getUsers: (params) => dispatch(getUsers(params)),
dispatch,
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question