DEV Community

loading...

Discussion on: You've been doing mapDispatchToProps wrong this entire time

Collapse
mcrowder65 profile image
Matt Crowder Author

That's true, and I feel like to someone new, it's more obvious what is going on, since it's explicit, dispatch is just injected into props, whereas using mapDispatchToProps... there's a lot of dependency injection going on behind the scenes that's hard to understand.

Collapse
thekashey profile image
Anton Korzunov

In this case actions you might emit would not a part of component’a public interface (aka props).
Giving ‘dispatch’ and letting component do whatever it wants - might not be a good idea.