{"action":"created","issue":{"url":"https://api.github.com/repos/react-webpack-generators/generator-react-webpack/issues/263","repository_url":"https://api.github.com/repos/react-webpack-generators/generator-react-webpack","labels_url":"https://api.github.com/repos/react-webpack-generators/generator-react-webpack/issues/263/labels{/name}","comments_url":"https://api.github.com/repos/react-webpack-generators/generator-react-webpack/issues/263/comments","events_url":"https://api.github.com/repos/react-webpack-generators/generator-react-webpack/issues/263/events","html_url":"https://github.com/react-webpack-generators/generator-react-webpack/issues/263","id":169182334,"number":263,"title":"V4 -- Provide sub generator to create HOCs","user":{"login":"sthzg","id":1827893,"avatar_url":"https://avatars.githubusercontent.com/u/1827893?v=3","gravatar_id":"","url":"https://api.github.com/users/sthzg","html_url":"https://github.com/sthzg","followers_url":"https://api.github.com/users/sthzg/followers","following_url":"https://api.github.com/users/sthzg/following{/other_user}","gists_url":"https://api.github.com/users/sthzg/gists{/gist_id}","starred_url":"https://api.github.com/users/sthzg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sthzg/subscriptions","organizations_url":"https://api.github.com/users/sthzg/orgs","repos_url":"https://api.github.com/users/sthzg/repos","events_url":"https://api.github.com/users/sthzg/events{/privacy}","received_events_url":"https://api.github.com/users/sthzg/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-03T17:02:56Z","updated_at":"2016-11-22T14:27:12Z","closed_at":"2016-11-22T14:27:12Z","body":"I would like to provide a sub generator to create higher order components, initially supporting the two architectures of hocs described [here](https://medium.com/@franleplant/react-higher-order-components-in-depth-cf9032ee6c3e#.kd0m1v8bd).\n\n**Props Proxy**\n\n``` js\nfunction withBar(WrappedComponent) {\n  return class Bar extends React.Component {\n    render() {\n      return <WrappedComponent {...this.props}/>\n    }\n  }\n}\n```\n\n**Extending from WrappedComponent**\n\n``` js\nfunction withFoo(WrappedComponent) {\n  return class Foo extends WrappedComponent {\n    // ...\n  }\n}\n```\n\nEspecially 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.\n"},"comment":{"url":"https://api.github.com/repos/react-webpack-generators/generator-react-webpack/issues/comments/262254133","html_url":"https://github.com/react-webpack-generators/generator-react-webpack/issues/263#issuecomment-262254133","issue_url":"https://api.github.com/repos/react-webpack-generators/generator-react-webpack/issues/263","id":262254133,"user":{"login":"sthzg","id":1827893,"avatar_url":"https://avatars.githubusercontent.com/u/1827893?v=3","gravatar_id":"","url":"https://api.github.com/users/sthzg","html_url":"https://github.com/sthzg","followers_url":"https://api.github.com/users/sthzg/followers","following_url":"https://api.github.com/users/sthzg/following{/other_user}","gists_url":"https://api.github.com/users/sthzg/gists{/gist_id}","starred_url":"https://api.github.com/users/sthzg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sthzg/subscriptions","organizations_url":"https://api.github.com/users/sthzg/orgs","repos_url":"https://api.github.com/users/sthzg/repos","events_url":"https://api.github.com/users/sthzg/events{/privacy}","received_events_url":"https://api.github.com/users/sthzg/received_events","type":"User","site_admin":false},"created_at":"2016-11-22T14:27:12Z","updated_at":"2016-11-22T14:27:12Z","body":"Closing due to inactivity."}}
{"actor":{"display_login":"sthzg"}}