{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4362","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4362/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4362/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4362/events","html_url":"https://github.com/Microsoft/TypeScript/issues/4362","id":101898311,"number":4362,"title":"Allow JSX element attributes type to be an intersection","user":{"login":"jbrantly","id":196944,"avatar_url":"https://avatars.githubusercontent.com/u/196944?v=3","gravatar_id":"","url":"https://api.github.com/users/jbrantly","html_url":"https://github.com/jbrantly","followers_url":"https://api.github.com/users/jbrantly/followers","following_url":"https://api.github.com/users/jbrantly/following{/other_user}","gists_url":"https://api.github.com/users/jbrantly/gists{/gist_id}","starred_url":"https://api.github.com/users/jbrantly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbrantly/subscriptions","organizations_url":"https://api.github.com/users/jbrantly/orgs","repos_url":"https://api.github.com/users/jbrantly/repos","events_url":"https://api.github.com/users/jbrantly/events{/privacy}","received_events_url":"https://api.github.com/users/jbrantly/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Accepting%20PRs","name":"Accepting PRs","color":"009800"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Bug","name":"Bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/2","html_url":"https://github.com/Microsoft/TypeScript/milestones/Community","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/2/labels","id":721044,"number":2,"title":"Community","description":"Issues in the 'Community' milestone are ones which we are accepting pull requests for","creator":{"login":"RyanCavanaugh","id":6685088,"avatar_url":"https://avatars.githubusercontent.com/u/6685088?v=3","gravatar_id":"","url":"https://api.github.com/users/RyanCavanaugh","html_url":"https://github.com/RyanCavanaugh","followers_url":"https://api.github.com/users/RyanCavanaugh/followers","following_url":"https://api.github.com/users/RyanCavanaugh/following{/other_user}","gists_url":"https://api.github.com/users/RyanCavanaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanCavanaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanCavanaugh/subscriptions","organizations_url":"https://api.github.com/users/RyanCavanaugh/orgs","repos_url":"https://api.github.com/users/RyanCavanaugh/repos","events_url":"https://api.github.com/users/RyanCavanaugh/events{/privacy}","received_events_url":"https://api.github.com/users/RyanCavanaugh/received_events","type":"User","site_admin":false},"open_issues":130,"closed_issues":49,"state":"open","created_at":"2014-07-14T23:24:58Z","updated_at":"2015-11-13T07:29:00Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-08-19T13:48:41Z","updated_at":"2015-11-20T10:33:51Z","closed_at":null,"body":"Consider the following:\r\n\r\n```typescript\r\ndeclare module JSX {\r\n    interface ElementAttributesProperty { props: {}; }\r\n}\r\n\r\nclass Component<P> {\r\n    props: P & { ref?: string };\r\n}\r\n```\r\n\r\nThis results in the error: JSX element attributes type '[type parameter] & { ref?: string; }' must be an object type.\r\n\r\nAn alternative would be an additional member of the JSX namespace that allowed specifying \"global\" attributes (that would apply to both value-based and intrinsic elements). For example:\r\n\r\n```typescript\r\ndeclare module JSX {\r\n    interface GlobalAttributes {\r\n        ref?: string\r\n    }\r\n}\r\n```\r\n\r\nSee also borisyankov/DefinitelyTyped#5347"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/158351537","html_url":"https://github.com/Microsoft/TypeScript/issues/4362#issuecomment-158351537","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4362","id":158351537,"user":{"login":"Pajn","id":817422,"avatar_url":"https://avatars.githubusercontent.com/u/817422?v=3","gravatar_id":"","url":"https://api.github.com/users/Pajn","html_url":"https://github.com/Pajn","followers_url":"https://api.github.com/users/Pajn/followers","following_url":"https://api.github.com/users/Pajn/following{/other_user}","gists_url":"https://api.github.com/users/Pajn/gists{/gist_id}","starred_url":"https://api.github.com/users/Pajn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pajn/subscriptions","organizations_url":"https://api.github.com/users/Pajn/orgs","repos_url":"https://api.github.com/users/Pajn/repos","events_url":"https://api.github.com/users/Pajn/events{/privacy}","received_events_url":"https://api.github.com/users/Pajn/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T10:33:50Z","updated_at":"2015-11-20T10:33:50Z","body":"A GlobalAttributes interface would be great because it would make it possible to add global attributes without redefining the entire typing file of for example react."}}