Closed
Description
We've been trying to migrate a lot of our containers from HOCs over to components that use render props
For the sake of consistency we're doing the same for connect
import PropTypes from "prop-types"
import { connect } from "react-redux"
const ReduxDataHandler = ({ render, ...propsToPass }) => {
return render(propsToPass)
}
ReduxDataHandler.propTypes = {
render: PropTypes.func.isRequired
}
const withReduxData = (mapStateToProps, mapDispatchToProps) => {
return connect(mapStateToProps, mapDispatchToProps)(ReduxDataHandler)
}
export default withReduxData
What would be awesome is if it would be possible to add a built in version of connect that does something similar but doesn't require adding this unnecessary wrapping. Would something like that be feasible?
Metadata
Metadata
Assignees
Labels
No labels