{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/368","labels_url":"https://api.github.com/repos/facebook/flow/issues/368/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/368/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/368/events","html_url":"https://github.com/facebook/flow/issues/368","id":66869947,"number":368,"title":"Correct way to type React events","user":{"login":"gcazaciuc","id":1248360,"avatar_url":"https://avatars.githubusercontent.com/u/1248360?v=3","gravatar_id":"","url":"https://api.github.com/users/gcazaciuc","html_url":"https://github.com/gcazaciuc","followers_url":"https://api.github.com/users/gcazaciuc/followers","following_url":"https://api.github.com/users/gcazaciuc/following{/other_user}","gists_url":"https://api.github.com/users/gcazaciuc/gists{/gist_id}","starred_url":"https://api.github.com/users/gcazaciuc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gcazaciuc/subscriptions","organizations_url":"https://api.github.com/users/gcazaciuc/orgs","repos_url":"https://api.github.com/users/gcazaciuc/repos","events_url":"https://api.github.com/users/gcazaciuc/events{/privacy}","received_events_url":"https://api.github.com/users/gcazaciuc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-07T12:20:48Z","updated_at":"2015-04-07T21:44:26Z","closed_at":null,"body":"I have the following code:\r\n\r\n handleChange: function(event:SyntheticEvent): void {\r\n         var el = event.target;\r\n         this.props.setNewLanguage(el.value);\r\n    }\r\n\r\nCan you please advise on the correct way of typing this function so that it doesn't throw a type error accessing el.value.\r\n\r\nI've found that using an union type works var el:HTMLInputElement|EventTarget but I'm not convinced that this is the correct way to type it. \r\nTyping it as only var el:HTMLInputElement = event.target throws a type error."},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/90740786","html_url":"https://github.com/facebook/flow/issues/368#issuecomment-90740786","issue_url":"https://api.github.com/repos/facebook/flow/issues/368","id":90740786,"user":{"login":"gcazaciuc","id":1248360,"avatar_url":"https://avatars.githubusercontent.com/u/1248360?v=3","gravatar_id":"","url":"https://api.github.com/users/gcazaciuc","html_url":"https://github.com/gcazaciuc","followers_url":"https://api.github.com/users/gcazaciuc/followers","following_url":"https://api.github.com/users/gcazaciuc/following{/other_user}","gists_url":"https://api.github.com/users/gcazaciuc/gists{/gist_id}","starred_url":"https://api.github.com/users/gcazaciuc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gcazaciuc/subscriptions","organizations_url":"https://api.github.com/users/gcazaciuc/orgs","repos_url":"https://api.github.com/users/gcazaciuc/repos","events_url":"https://api.github.com/users/gcazaciuc/events{/privacy}","received_events_url":"https://api.github.com/users/gcazaciuc/received_events","type":"User","site_admin":false},"created_at":"2015-04-07T21:44:26Z","updated_at":"2015-04-07T21:44:26Z","body":"Thank you very much for the suggestions. Using dynamic type test makes sense to me but  I'm not quite clear  on how to do the cast( and haven't found a suggestion in the docs)."}}