{"action":"created","issue":{"url":"https://api.github.com/repos/zeit/next.js/issues/192","repository_url":"https://api.github.com/repos/zeit/next.js","labels_url":"https://api.github.com/repos/zeit/next.js/issues/192/labels{/name}","comments_url":"https://api.github.com/repos/zeit/next.js/issues/192/comments","events_url":"https://api.github.com/repos/zeit/next.js/issues/192/events","html_url":"https://github.com/zeit/next.js/issues/192","id":187108169,"number":192,"title":"Need to manually re-call getInitialProps of sub-components","user":{"login":"sedubois","id":4217871,"avatar_url":"https://avatars.githubusercontent.com/u/4217871?v=3","gravatar_id":"","url":"https://api.github.com/users/sedubois","html_url":"https://github.com/sedubois","followers_url":"https://api.github.com/users/sedubois/followers","following_url":"https://api.github.com/users/sedubois/following{/other_user}","gists_url":"https://api.github.com/users/sedubois/gists{/gist_id}","starred_url":"https://api.github.com/users/sedubois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sedubois/subscriptions","organizations_url":"https://api.github.com/users/sedubois/orgs","repos_url":"https://api.github.com/users/sedubois/repos","events_url":"https://api.github.com/users/sedubois/events{/privacy}","received_events_url":"https://api.github.com/users/sedubois/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-11-03T16:02:34Z","updated_at":"2016-11-07T13:53:16Z","closed_at":null,"body":"As described here: https://github.com/zeit/next.js/issues/159#issuecomment-257318970 and as far as I understand, if some React component has a `getInitialProps`, then all of its parents are condemned to need it too, and each parent in turn needs to call `getInitialProps` on their children, in the right order, making sure not to duplicate the work between the different levels of ancestry (the linked issue shows the case of a higher-component style, but the same applies when passing components as React children the normal way).\r\n\r\nForgetting one of these calls can lead to silent bugs such as not having server-side rendering, and this code repetition can hinder proper componentization (one of React's key patterns).\r\n\r\nFrom an end-user perspective, just like with React component lifecycle methods such as `componentWillMount` etc, IMHO the developer should trust that `getInitialProps` will be called no matter what, as long as it's spelled properly.\r\n\r\nCould Next.js handle `getInitialProps` as part of the React component lifecycle or implement the same kind of magic to make sure it gets called whenever defined in a component?\r\n\r\nI'm new to SSR and Next.js, so apologies if this makes no sense 😄"},"comment":{"url":"https://api.github.com/repos/zeit/next.js/issues/comments/258840675","html_url":"https://github.com/zeit/next.js/issues/192#issuecomment-258840675","issue_url":"https://api.github.com/repos/zeit/next.js/issues/192","id":258840675,"user":{"login":"sedubois","id":4217871,"avatar_url":"https://avatars.githubusercontent.com/u/4217871?v=3","gravatar_id":"","url":"https://api.github.com/users/sedubois","html_url":"https://github.com/sedubois","followers_url":"https://api.github.com/users/sedubois/followers","following_url":"https://api.github.com/users/sedubois/following{/other_user}","gists_url":"https://api.github.com/users/sedubois/gists{/gist_id}","starred_url":"https://api.github.com/users/sedubois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sedubois/subscriptions","organizations_url":"https://api.github.com/users/sedubois/orgs","repos_url":"https://api.github.com/users/sedubois/repos","events_url":"https://api.github.com/users/sedubois/events{/privacy}","received_events_url":"https://api.github.com/users/sedubois/received_events","type":"User","site_admin":false},"created_at":"2016-11-07T13:53:15Z","updated_at":"2016-11-07T13:53:15Z","body":"@dbismut [`redux-connect`](https://github.com/makeomatic/redux-connect) (forked from [`redux-async-connect`](https://github.com/Rezonans/redux-async-connect)) looks promising 👍  However that requires a Redux store, and although I think that's the way to go, I'm not sure the Next.js team would have the same opinion? @nkzawa "}}
{"actor":{"display_login":"sedubois"}}