{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react/issues/5047","repository_url":"https://api.github.com/repos/facebook/react","labels_url":"https://api.github.com/repos/facebook/react/issues/5047/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/5047/comments","events_url":"https://api.github.com/repos/facebook/react/issues/5047/events","html_url":"https://github.com/facebook/react/issues/5047","id":109631671,"number":5047,"title":"Default lifecycle methods on React.Component ?","user":{"login":"arcanis","id":1037931,"avatar_url":"https://avatars.githubusercontent.com/u/1037931?v=3","gravatar_id":"","url":"https://api.github.com/users/arcanis","html_url":"https://github.com/arcanis","followers_url":"https://api.github.com/users/arcanis/followers","following_url":"https://api.github.com/users/arcanis/following{/other_user}","gists_url":"https://api.github.com/users/arcanis/gists{/gist_id}","starred_url":"https://api.github.com/users/arcanis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arcanis/subscriptions","organizations_url":"https://api.github.com/users/arcanis/orgs","repos_url":"https://api.github.com/users/arcanis/repos","events_url":"https://api.github.com/users/arcanis/events{/privacy}","received_events_url":"https://api.github.com/users/arcanis/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2015-10-03T16:36:36Z","updated_at":"2016-10-27T14:50:32Z","closed_at":"2016-10-27T14:50:32Z","body":"Just a small API detail: would it make sense to implement default (empty) lifecycle methods in the base React.Component class? It would allow to have homogenous implementations as far as super() calls are concerned.\r\n\r\nFor example, the following will throw due to the missing `componentDidMount` implementation in the parent class:\r\n\r\n```\r\nclass Foo extends React.Component {\r\n    componentDidMount( ) {\r\n        super.componentDidMount( );\r\n    }\r\n};\r\n```\r\n\r\nHowever, when overloading the `Foo` class, a missing super call might introduce some bugs. That's what got me to think that maybe it was safer to always put the super-call, and then I discovered that it was not possible when heriting from the base class.\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/react/issues/comments/256663829","html_url":"https://github.com/facebook/react/issues/5047#issuecomment-256663829","issue_url":"https://api.github.com/repos/facebook/react/issues/5047","id":256663829,"user":{"login":"gaearon","id":810438,"avatar_url":"https://avatars.githubusercontent.com/u/810438?v=3","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"created_at":"2016-10-27T14:50:32Z","updated_at":"2016-10-27T14:50:32Z","body":"We won't be doing this.\r\nI also wrote about alternatives to inheritance:\r\nhttps://facebook.github.io/react/docs/composition-vs-inheritance.html"}}
{"actor":{"display_login":"gaearon"}}