I would like to provide a sub generator to create higher order components, initially supporting the two architectures of hocs described here.
Props Proxy
function withBar(WrappedComponent) {
return class Bar extends React.Component {
render() {
return <WrappedComponent {...this.props}/>
}
}
}
Extending from WrappedComponent
function withFoo(WrappedComponent) {
return class Foo extends WrappedComponent {
// ...
}
}
Especially the second kind of architecture I am using quite often in a current project and I think it would be a good addition to the V4 generator. Would you be interested to merge it in? If positive, I would create a new directory src/hocs in the template repo (including a webpack alias and an update in the .eslintrc) and let the subgen create the files there.
I would like to provide a sub generator to create higher order components, initially supporting the two architectures of hocs described here.
Props Proxy
Extending from WrappedComponent
Especially the second kind of architecture I am using quite often in a current project and I think it would be a good addition to the V4 generator. Would you be interested to merge it in? If positive, I would create a new directory
src/hocs
in the template repo (including a webpack alias and an update in the .eslintrc) and let the subgen create the files there.