-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Description
I'm experimenting with composing several higher-order-components, like so:
compose(
connect(mapStateToProps),
authorize(unauthorizedAction),
loadData(loadDataAction)
)(MyComponent);
It would be really nice if I could count on connect-ed components always having dispatch defined. Because if I do this:
compose(
connect(mapStateToProps, { someAction, anotherAction }),
authorize(unauthorizedAction),
loadData(loadDataAction)
)(MyComponent);
...then my dispatch goes away in the connected component, and I have to implement a much more awkward mapDispatchToProps in order to get it back.
It's worth noting that redux-form also suffers from this problem.
IMO, being able to rely on some consistent props in a connected component would make this kind of third-party composition a lot easier.
andrewmclagan, rafallyczkowski and serraventura
Metadata
Metadata
Assignees
Labels
No labels