{"action":"closed","issue":{"url":"https://api.github.com/repos/facebook/react/issues/2982","labels_url":"https://api.github.com/repos/facebook/react/issues/2982/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/2982/comments","events_url":"https://api.github.com/repos/facebook/react/issues/2982/events","html_url":"https://github.com/facebook/react/issues/2982","id":55988679,"number":2982,"title":"Access to `this.props.children` functions","user":{"login":"dhruvasagar","id":88258,"avatar_url":"https://avatars.githubusercontent.com/u/88258?v=3","gravatar_id":"","url":"https://api.github.com/users/dhruvasagar","html_url":"https://github.com/dhruvasagar","followers_url":"https://api.github.com/users/dhruvasagar/followers","following_url":"https://api.github.com/users/dhruvasagar/following{/other_user}","gists_url":"https://api.github.com/users/dhruvasagar/gists{/gist_id}","starred_url":"https://api.github.com/users/dhruvasagar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhruvasagar/subscriptions","organizations_url":"https://api.github.com/users/dhruvasagar/orgs","repos_url":"https://api.github.com/users/dhruvasagar/repos","events_url":"https://api.github.com/users/dhruvasagar/events{/privacy}","received_events_url":"https://api.github.com/users/dhruvasagar/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-01-30T02:56:56Z","updated_at":"2015-02-03T03:42:19Z","closed_at":"2015-02-03T03:42:19Z","body":"The following is a snippet to demonstrate the use case I am trying to achieve. \r\n```javascript\r\nvar Parent = React.createClass({\r\n  componentDidMount: function() {\r\n    React.Children.forEach(this.props.children, function(child) {\r\n      console.log('test' in child);\r\n    });\r\n  },\r\n  \r\n  render: function() {\r\n    return <div>{this.props.children}</div>;\r\n  }\r\n});\r\n\r\nvar Child = React.createClass({\r\n  test: function() {\r\n    console.log('this is a test');\r\n  },\r\n  \r\n  render: function() {\r\n    return <span>Child</span>;\r\n  }\r\n});\r\n\r\nReact.render(<Parent><Child/></Parent>, document.body);\r\n```\r\nLike you'd know, while iterating through `this.props.children` I am unable to get a reference to the actual component, or at least not able to figure out how so that I could access the child component's API.\r\n\r\nIs there anyway I could do this !? If not, why !?\r\n\r\nEdit: I am aware that I can add a ref to the child component and then use that to do this, but my goal is that the parent should not care about what it's children are or restrict / limit that in any way."}}