{"action":"opened","issue":{"url":"https://api.github.com/repos/sinnerschrader/patternplate-server/issues/53","repository_url":"https://api.github.com/repos/sinnerschrader/patternplate-server","labels_url":"https://api.github.com/repos/sinnerschrader/patternplate-server/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/sinnerschrader/patternplate-server/issues/53/comments","events_url":"https://api.github.com/repos/sinnerschrader/patternplate-server/issues/53/events","html_url":"https://github.com/sinnerschrader/patternplate-server/issues/53","id":133585849,"number":53,"title":"Proposal: Separate stateful / stateless components","user":{"login":"ZauberNerd","id":249542,"avatar_url":"https://avatars.githubusercontent.com/u/249542?v=3","gravatar_id":"","url":"https://api.github.com/users/ZauberNerd","html_url":"https://github.com/ZauberNerd","followers_url":"https://api.github.com/users/ZauberNerd/followers","following_url":"https://api.github.com/users/ZauberNerd/following{/other_user}","gists_url":"https://api.github.com/users/ZauberNerd/gists{/gist_id}","starred_url":"https://api.github.com/users/ZauberNerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZauberNerd/subscriptions","organizations_url":"https://api.github.com/users/ZauberNerd/orgs","repos_url":"https://api.github.com/users/ZauberNerd/repos","events_url":"https://api.github.com/users/ZauberNerd/events{/privacy}","received_events_url":"https://api.github.com/users/ZauberNerd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-14T22:03:03Z","updated_at":"2016-02-14T22:03:03Z","closed_at":null,"body":"Instead of having to create and export a react component class every time,\r\nI would propose to make use of `default` and `named exports`.\r\nSo that a stateless component could be written like this (but still be able to use `propTypes` / other static properties):\r\n```javascript\r\nimport Input from 'input';\r\n\r\nexport default (\r\n  <Input className={this.props.className} />\r\n);\r\n\r\nexport const propTypes = {\r\n  className: React.PropTypes.string\r\n};\r\n\r\nexport const defaultProps = {\r\n  className: 'foo'\r\n};\r\n```\r\nAnd for the case where we actually need stateful components we could fall back to using classes (`export default class Input extends React.Component { ... }`)."}}