{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react/issues/5180","labels_url":"https://api.github.com/repos/facebook/react/issues/5180/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/5180/comments","events_url":"https://api.github.com/repos/facebook/react/issues/5180/events","html_url":"https://github.com/facebook/react/issues/5180","id":111605493,"number":5180,"title":"data-* attribute working only for html elements but not for custom component (0.13.3)","user":{"login":"stepancar","id":2854910,"avatar_url":"https://avatars.githubusercontent.com/u/2854910?v=3","gravatar_id":"","url":"https://api.github.com/users/stepancar","html_url":"https://github.com/stepancar","followers_url":"https://api.github.com/users/stepancar/followers","following_url":"https://api.github.com/users/stepancar/following{/other_user}","gists_url":"https://api.github.com/users/stepancar/gists{/gist_id}","starred_url":"https://api.github.com/users/stepancar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stepancar/subscriptions","organizations_url":"https://api.github.com/users/stepancar/orgs","repos_url":"https://api.github.com/users/stepancar/repos","events_url":"https://api.github.com/users/stepancar/events{/privacy}","received_events_url":"https://api.github.com/users/stepancar/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-15T12:23:17Z","updated_at":"2015-10-15T17:29:12Z","closed_at":"2015-10-15T14:18:53Z","body":"Hello! \r\nI create Component <MyComponent>\r\n\r\nthen try \r\n```html\r\n<div data-test-id={'parent'}>\r\n       <MyComponent data-test-id={'child'} />\r\n<div>\r\n```\r\nin generated html you can find  data-test-id=\"parent\"\r\nbut data-test-id=\"child\" for root element of MyComponent can't find.\r\nMay be data-* attribute for custom component should be maped for root element?\r\nThank you!"},"comment":{"url":"https://api.github.com/repos/facebook/react/issues/comments/148466243","html_url":"https://github.com/facebook/react/issues/5180#issuecomment-148466243","issue_url":"https://api.github.com/repos/facebook/react/issues/5180","id":148466243,"user":{"login":"titoBouzout","id":64156,"avatar_url":"https://avatars.githubusercontent.com/u/64156?v=3","gravatar_id":"","url":"https://api.github.com/users/titoBouzout","html_url":"https://github.com/titoBouzout","followers_url":"https://api.github.com/users/titoBouzout/followers","following_url":"https://api.github.com/users/titoBouzout/following{/other_user}","gists_url":"https://api.github.com/users/titoBouzout/gists{/gist_id}","starred_url":"https://api.github.com/users/titoBouzout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/titoBouzout/subscriptions","organizations_url":"https://api.github.com/users/titoBouzout/orgs","repos_url":"https://api.github.com/users/titoBouzout/repos","events_url":"https://api.github.com/users/titoBouzout/events{/privacy}","received_events_url":"https://api.github.com/users/titoBouzout/received_events","type":"User","site_admin":false},"created_at":"2015-10-15T17:29:12Z","updated_at":"2015-10-15T17:29:12Z","body":"Because the component may have many children, or even sub React Components. Imagine this case: \r\n\r\n    var MyComponent= React.createClass({\r\n        render: function () {\r\n            var data= this.props['data-test-id'];\r\n            return <div>\r\n                <div> username </div>\r\n                <img className=\"user-profile-image\">\r\n                <div>last login <span>some day</span></div>\r\n                <SomeCoolThing data-test-id={data}/>\r\n            </div>\r\n        }\r\n    });"}}