{"action":"created","issue":{"url":"https://api.github.com/repos/Yomguithereal/baobab-react/issues/52","labels_url":"https://api.github.com/repos/Yomguithereal/baobab-react/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/Yomguithereal/baobab-react/issues/52/comments","events_url":"https://api.github.com/repos/Yomguithereal/baobab-react/issues/52/events","html_url":"https://github.com/Yomguithereal/baobab-react/issues/52","id":76705132,"number":52,"title":"this.props.children not supported?","user":{"login":"srcspider","id":338910,"avatar_url":"https://avatars.githubusercontent.com/u/338910?v=3","gravatar_id":"","url":"https://api.github.com/users/srcspider","html_url":"https://github.com/srcspider","followers_url":"https://api.github.com/users/srcspider/followers","following_url":"https://api.github.com/users/srcspider/following{/other_user}","gists_url":"https://api.github.com/users/srcspider/gists{/gist_id}","starred_url":"https://api.github.com/users/srcspider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srcspider/subscriptions","organizations_url":"https://api.github.com/users/srcspider/orgs","repos_url":"https://api.github.com/users/srcspider/repos","events_url":"https://api.github.com/users/srcspider/events{/privacy}","received_events_url":"https://api.github.com/users/srcspider/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-15T11:56:36Z","updated_at":"2015-05-15T12:15:32Z","closed_at":null,"body":"Any reason why it doesn't work with children? \r\n\r\nIf it's not possible it should be mentioend since currently it says \"Root aims at passing a baobab tree through context so that child component (branches) may use it\" which may confuse people skimming though it to get a quick proof of concept going.\r\n\r\n---\r\n\r\n**Test Case**\r\n\r\n```js\r\nvar React = require('react'),\r\n\tBaobab = require('baobab');\r\n\r\nvar mixin = {\r\n\troot: require('baobab-react/mixins').root,\r\n\tbranch: require('baobab-react/mixins').branch,\r\n};\r\n\r\nvar tree = new Baobab({\r\n\tname: 'John',\r\n\tsurname: 'Talbot'\r\n});\r\n\r\nvar Test = React.createClass({\r\n\tmixins: [ mixin.branch ],\r\n\tcursors: {\r\n\t\tname: [ 'name' ]\r\n\t},\r\n\trender: function () {\r\n\t\treturn <div>hi {this.state.name}</div>;\r\n\t}\r\n});\r\n\r\nvar Root = React.createClass({\r\n\tmixins: [ mixin.root ],\r\n\trender: function () {\r\n\t\treturn (\r\n\t\t\t<div>{this.props.children}</div>\r\n\t\t);\r\n\t}\r\n});\r\n\r\nvar mountPoint = document.querySelector('#mountPoint');\r\n\r\nReact.render(<Root tree={tree}><Test /></Root>, mountPoint);\r\n```\r\n\r\nExpected: \"Hi John\"\r\n\r\nActual: \r\n```js\r\nUncaught TypeError: Cannot read property 'createFacet' of undefined\r\n```"},"comment":{"url":"https://api.github.com/repos/Yomguithereal/baobab-react/issues/comments/102384296","html_url":"https://github.com/Yomguithereal/baobab-react/issues/52#issuecomment-102384296","issue_url":"https://api.github.com/repos/Yomguithereal/baobab-react/issues/52","id":102384296,"user":{"login":"Yomguithereal","id":2571951,"avatar_url":"https://avatars.githubusercontent.com/u/2571951?v=3","gravatar_id":"","url":"https://api.github.com/users/Yomguithereal","html_url":"https://github.com/Yomguithereal","followers_url":"https://api.github.com/users/Yomguithereal/followers","following_url":"https://api.github.com/users/Yomguithereal/following{/other_user}","gists_url":"https://api.github.com/users/Yomguithereal/gists{/gist_id}","starred_url":"https://api.github.com/users/Yomguithereal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yomguithereal/subscriptions","organizations_url":"https://api.github.com/users/Yomguithereal/orgs","repos_url":"https://api.github.com/users/Yomguithereal/repos","events_url":"https://api.github.com/users/Yomguithereal/events{/privacy}","received_events_url":"https://api.github.com/users/Yomguithereal/received_events","type":"User","site_admin":false},"created_at":"2015-05-15T12:15:32Z","updated_at":"2015-05-15T12:15:32Z","body":"Hello @srcspider: this error occur because the rendered children has not access to the same context as set by your root component. This is unfortunately a known react problem (see [here](https://github.com/facebook/react/issues/1562)). [This](http://stackoverflow.com/questions/28780998/how-can-i-pass-props-context-to-dynamic-childrens-in-react/28783973#28783973) stackoverflow thread also gives a potential solution.\r\n\r\nThere are some discussion about react currently to decide whether this should evolve but I am not aware of the outcome."}}