{"action":"created","issue":{"url":"https://api.github.com/repos/mxstbr/react-boilerplate/issues/913","repository_url":"https://api.github.com/repos/mxstbr/react-boilerplate","labels_url":"https://api.github.com/repos/mxstbr/react-boilerplate/issues/913/labels{/name}","comments_url":"https://api.github.com/repos/mxstbr/react-boilerplate/issues/913/comments","events_url":"https://api.github.com/repos/mxstbr/react-boilerplate/issues/913/events","html_url":"https://github.com/mxstbr/react-boilerplate/issues/913","id":172916506,"number":913,"title":"props.children returns null","user":{"login":"mnemanja","id":1423218,"avatar_url":"https://avatars.githubusercontent.com/u/1423218?v=3","gravatar_id":"","url":"https://api.github.com/users/mnemanja","html_url":"https://github.com/mnemanja","followers_url":"https://api.github.com/users/mnemanja/followers","following_url":"https://api.github.com/users/mnemanja/following{/other_user}","gists_url":"https://api.github.com/users/mnemanja/gists{/gist_id}","starred_url":"https://api.github.com/users/mnemanja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnemanja/subscriptions","organizations_url":"https://api.github.com/users/mnemanja/orgs","repos_url":"https://api.github.com/users/mnemanja/repos","events_url":"https://api.github.com/users/mnemanja/events{/privacy}","received_events_url":"https://api.github.com/users/mnemanja/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-24T10:23:05Z","updated_at":"2016-08-30T08:51:20Z","closed_at":"2016-08-30T08:51:20Z","body":"I'm trying to create a nested route, and I'm expecting `props.children` to exist so that I could use it in the template i.e. `{React.cloneElement(this.props.children, { parentsData: this.props.parentsData })}`.\r\n\r\nHowever what ever I've tried results in that property being `null`.\r\nWhere am I failing?\r\n\r\nThis is my routers configuration:\r\n```\r\nreturn [\r\n    {\r\n      path: '/',\r\n      name: 'home',\r\n      getComponent(nextState, cb) {\r\n        const importModules = Promise.all([\r\n          System.import('containers/HomePage/reducer'),\r\n          System.import('containers/HomePage/sagas'),\r\n          System.import('containers/HomePage'),\r\n        ]);\r\n\r\n        const renderRoute = loadModule(cb);\r\n\r\n        importModules.then(([reducer, sagas, component]) => {\r\n          injectReducer('home', reducer.default);\r\n          injectSagas(sagas.default);\r\n\r\n          renderRoute(component);\r\n        });\r\n\r\n        importModules.catch(errorLoading);\r\n      },\r\n    },\r\n    {\r\n      path: '/test',\r\n      name: 'test',\r\n      getComponent(nextState, cb) {\r\n        const importModules = Promise.all([\r\n          System.import('containers/Test'),\r\n        ]);\r\n\r\n        const renderRoute = loadModule(cb);\r\n\r\n        importModules.then(([component]) => {\r\n          renderRoute(component);\r\n        });\r\n\r\n        importModules.catch(errorLoading);\r\n      },\r\n      getChildRoutes: [\r\n        {\r\n          path: 'about',\r\n          name: 'about',\r\n          getComponent(nextState, cb) {\r\n            const importModules = Promise.all([\r\n              System.import('containers/About'),\r\n            ]);\r\n\r\n            const renderRoute = loadModule(cb);\r\n\r\n            importModules.then(([component]) => {\r\n              renderRoute(component);\r\n            });\r\n\r\n            importModules.catch(errorLoading);\r\n          },\r\n        },\r\n      ],\r\n    },\r\n    {\r\n      path: '*',\r\n      name: 'notfound',\r\n      getComponent(nextState, cb) {\r\n        System.import('containers/NotFoundPage')\r\n          .then(loadModule(cb))\r\n          .catch(errorLoading);\r\n      },\r\n    },\r\n  ];\r\n```\r\n\r\nWhen I do navigate to the nested route I get this error: \r\n``Uncaught TypeError: route.getChildRoutes is not a function``"},"comment":{"url":"https://api.github.com/repos/mxstbr/react-boilerplate/issues/comments/243374847","html_url":"https://github.com/mxstbr/react-boilerplate/issues/913#issuecomment-243374847","issue_url":"https://api.github.com/repos/mxstbr/react-boilerplate/issues/913","id":243374847,"user":{"login":"mnemanja","id":1423218,"avatar_url":"https://avatars.githubusercontent.com/u/1423218?v=3","gravatar_id":"","url":"https://api.github.com/users/mnemanja","html_url":"https://github.com/mnemanja","followers_url":"https://api.github.com/users/mnemanja/followers","following_url":"https://api.github.com/users/mnemanja/following{/other_user}","gists_url":"https://api.github.com/users/mnemanja/gists{/gist_id}","starred_url":"https://api.github.com/users/mnemanja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnemanja/subscriptions","organizations_url":"https://api.github.com/users/mnemanja/orgs","repos_url":"https://api.github.com/users/mnemanja/repos","events_url":"https://api.github.com/users/mnemanja/events{/privacy}","received_events_url":"https://api.github.com/users/mnemanja/received_events","type":"User","site_admin":false},"created_at":"2016-08-30T08:51:20Z","updated_at":"2016-08-30T08:51:20Z","body":"Thanks @mxstbr for this example:\r\nhttps://github.com/mxstbr/react-boilerplate/issues/499\r\n`getChildRoutes` was the mistake that I've made and should have used `childRoutes`.\r\n\r\nAlso the confusion that I've had was due to the object `children` which I've expected to be populated when in the parent route. Actually it gets populated when on the child's route (the parent component gets the data then). All makes sense now :)"}}
{"actor":{"display_login":"mnemanja"}}