{"action":"created","issue":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/20942","repository_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped","labels_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/20942/labels{/name}","comments_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/20942/comments","events_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/20942/events","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/issues/20942","id":267873390,"number":20942,"title":"@types/react does not allow returning ReactPortal from render","user":{"login":"Kovensky","id":73085,"avatar_url":"https://avatars1.githubusercontent.com/u/73085?v=4","gravatar_id":"","url":"https://api.github.com/users/Kovensky","html_url":"https://github.com/Kovensky","followers_url":"https://api.github.com/users/Kovensky/followers","following_url":"https://api.github.com/users/Kovensky/following{/other_user}","gists_url":"https://api.github.com/users/Kovensky/gists{/gist_id}","starred_url":"https://api.github.com/users/Kovensky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kovensky/subscriptions","organizations_url":"https://api.github.com/users/Kovensky/orgs","repos_url":"https://api.github.com/users/Kovensky/repos","events_url":"https://api.github.com/users/Kovensky/events{/privacy}","received_events_url":"https://api.github.com/users/Kovensky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-10-24T02:05:57Z","updated_at":"2017-12-08T03:38:38Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"A `ReactPortal` is not accepted as a valid `ReactElement` as it does not have a `type` or `props` key. However, React itself does accept `ReactPortals` as a valid return value.\r\n\r\nThis might be a bit tricky to fix as simply changing `StatelessComponent`/`ComponentClass` to return `ReactElement|ReactPortal` will probably break many things.\r\n\r\nThis problem will also probably repeat itself with future `React.Fragment`.\r\n\r\n```tsx\r\ninterface PortalProps {\r\n  children: React.ReactNode\r\n  target: Element\r\n}\r\n// type error: ReactPortal not assignable to ReactElement\r\nconst Portal: React.SFC<PortalProps> = ({ children, target }: PortalProps) => ReactDOM.createPortal(children, target)\r\nconst Portal2 = ({ children, target }: PortalProps) => ReactDOM.createPortal(children, target)\r\n// type error: Portal2 is not a constructor for JSX elements\r\nconst test = <Portal2 target={document.body}>test</Portal2>\r\n```"},"comment":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/comments/350163699","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/issues/20942#issuecomment-350163699","issue_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/20942","id":350163699,"user":{"login":"rosskevin","id":136564,"avatar_url":"https://avatars1.githubusercontent.com/u/136564?v=4","gravatar_id":"","url":"https://api.github.com/users/rosskevin","html_url":"https://github.com/rosskevin","followers_url":"https://api.github.com/users/rosskevin/followers","following_url":"https://api.github.com/users/rosskevin/following{/other_user}","gists_url":"https://api.github.com/users/rosskevin/gists{/gist_id}","starred_url":"https://api.github.com/users/rosskevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rosskevin/subscriptions","organizations_url":"https://api.github.com/users/rosskevin/orgs","repos_url":"https://api.github.com/users/rosskevin/repos","events_url":"https://api.github.com/users/rosskevin/events{/privacy}","received_events_url":"https://api.github.com/users/rosskevin/received_events","type":"User","site_admin":false},"created_at":"2017-12-08T03:38:38Z","updated_at":"2017-12-08T03:38:38Z","author_association":"CONTRIBUTOR","body":"Ok, so I seem to have figured _something_ out.  When I used `ncu` it updated existing `^16.0.27` to `^16.0.28`, and I yarn installed.  This somehow put the project in a bad state.\r\n\r\nAs mentioned above, `rm -rf node_modules && yarn` didn't solve the problem, but rm -rf node_modules yarn.lock && yarn` **did** solve the problem.  Evidently forcing yarn to do a from-scratch dependency resolution had an an effect on the results."}}
{"actor":{"display_login":"rosskevin"}}