{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react/issues/4729","labels_url":"https://api.github.com/repos/facebook/react/issues/4729/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/4729/comments","events_url":"https://api.github.com/repos/facebook/react/issues/4729/events","html_url":"https://github.com/facebook/react/issues/4729","id":103602731,"number":4729,"title":"Rendering input element to string, then setting html dangerously doesn't fire onChange anymore","user":{"login":"Radivarig","id":6281737,"avatar_url":"https://avatars.githubusercontent.com/u/6281737?v=3","gravatar_id":"","url":"https://api.github.com/users/Radivarig","html_url":"https://github.com/Radivarig","followers_url":"https://api.github.com/users/Radivarig/followers","following_url":"https://api.github.com/users/Radivarig/following{/other_user}","gists_url":"https://api.github.com/users/Radivarig/gists{/gist_id}","starred_url":"https://api.github.com/users/Radivarig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Radivarig/subscriptions","organizations_url":"https://api.github.com/users/Radivarig/orgs","repos_url":"https://api.github.com/users/Radivarig/repos","events_url":"https://api.github.com/users/Radivarig/events{/privacy}","received_events_url":"https://api.github.com/users/Radivarig/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-27T21:50:34Z","updated_at":"2015-08-27T22:15:51Z","closed_at":"2015-08-27T22:03:38Z","body":"I have the following input element:\r\n```\r\n   var InputElement = <input onChange={function(e){console.log(e.target.value)}} />\r\n```\r\nif I return like this, callback is fired on input change\r\n```\r\n    return InputElement\r\n```\r\nhowever, if I do the following, onChange will **not** be called\r\n```\r\n    return (\r\n      <div dangerouslySetInnerHTML={{__html: React.renderToString(InputElement)}} />\r\n    )\r\n```\r\nHow can I preserve the onChange?"},"comment":{"url":"https://api.github.com/repos/facebook/react/issues/comments/135570895","html_url":"https://github.com/facebook/react/issues/4729#issuecomment-135570895","issue_url":"https://api.github.com/repos/facebook/react/issues/4729","id":135570895,"user":{"login":"Radivarig","id":6281737,"avatar_url":"https://avatars.githubusercontent.com/u/6281737?v=3","gravatar_id":"","url":"https://api.github.com/users/Radivarig","html_url":"https://github.com/Radivarig","followers_url":"https://api.github.com/users/Radivarig/followers","following_url":"https://api.github.com/users/Radivarig/following{/other_user}","gists_url":"https://api.github.com/users/Radivarig/gists{/gist_id}","starred_url":"https://api.github.com/users/Radivarig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Radivarig/subscriptions","organizations_url":"https://api.github.com/users/Radivarig/orgs","repos_url":"https://api.github.com/users/Radivarig/repos","events_url":"https://api.github.com/users/Radivarig/events{/privacy}","received_events_url":"https://api.github.com/users/Radivarig/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T22:15:51Z","updated_at":"2015-08-27T22:15:51Z","body":"I am rendering to string because I need markdown parser to insert tags around react elements, and it takes and returns a string.\r\n\r\nSo I can achieve transformation from:\r\n```\r\n<span>this is span before **</span>\r\n  <ReactComponent/>\r\n<span>** and span after component</span>\r\n```\r\nto:\r\n```\r\n<span>this is span before </span>\r\n  <strong>\r\n    <ReactComponent/>\r\n  </strong>\r\n<span> and span after component</span>\r\n```"}}