I
I
Ivan Steblev2016-09-22 14:58:03
React
Ivan Steblev, 2016-09-22 14:58:03

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

1 answer(s)
M
Maxim, 2016-09-22
@flexsa

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,
})

PS Show an example of passing functions from actions through the component tree, and if you have already identified something interesting for yourself in this approach, write. Let's watch together.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question