{"action":"created","issue":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/11935","repository_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped","labels_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/11935/labels{/name}","comments_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/11935/comments","events_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/11935/events","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/11935","id":182544963,"number":11935,"title":"[types-2.0] react - better strict mode compatibility","user":{"login":"beckend","id":6056334,"avatar_url":"https://avatars.githubusercontent.com/u/6056334?v=3","gravatar_id":"","url":"https://api.github.com/users/beckend","html_url":"https://github.com/beckend","followers_url":"https://api.github.com/users/beckend/followers","following_url":"https://api.github.com/users/beckend/following{/other_user}","gists_url":"https://api.github.com/users/beckend/gists{/gist_id}","starred_url":"https://api.github.com/users/beckend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beckend/subscriptions","organizations_url":"https://api.github.com/users/beckend/orgs","repos_url":"https://api.github.com/users/beckend/repos","events_url":"https://api.github.com/users/beckend/events{/privacy}","received_events_url":"https://api.github.com/users/beckend/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-12T14:45:00Z","updated_at":"2016-10-13T07:08:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/11935","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/11935","diff_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/11935.diff","patch_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/11935.patch"},"body":"# index.d.ts\r\n\r\n- line 16, `Key` was changed to accept null, When you do `React.createElement(...)` and you do not supply a key, it becomes the value `null`.\r\n\r\n- line 40, `ComponentClass<P>`, when testing `React.cloneElement` which is able to accept `null` and `undefined`, had to add `any` type.\r\n\r\n- line 77, `DOMFactory<P, T>`, using any `React.DOM.xxx` function to create an element. For example `React.DOM.div(null, undefined)` actually works and thus added.\r\n\r\n- line 96, a React child can be `null`.\r\n\r\n- line 202, the last [commit](https://github.com/DefinitelyTyped/DefinitelyTyped/commit/b329e7ec15c7a6dbebfca0e0ed916cb5f60f269a) added the return type of `null` to `SFC<P>` and in strict mode there was no longer the possibility to render the component any more, it will say `null is not a constructor function for jsx elements.`. A workaround is to convert it to an interface then overload the constructor function to have let `SFC<P>` to have the ability to return null, but leave `StatelessComponent<P>` alone. You now have 2 versions to work with, in strict mode `SFC<P>` will fail to render every time because of `null` return, but `StatelessComponent<P>` will work.\r\n\r\n- line 265, `ComponentSpec.render`, the render may return `null` like every other render.\r\n\r\n----\r\n\r\nThe rest of the files had to be adjusted accordingly when using `strictNullChecks`."},"comment":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/comments/253432103","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/11935#issuecomment-253432103","issue_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/11935","id":253432103,"user":{"login":"beckend","id":6056334,"avatar_url":"https://avatars.githubusercontent.com/u/6056334?v=3","gravatar_id":"","url":"https://api.github.com/users/beckend","html_url":"https://github.com/beckend","followers_url":"https://api.github.com/users/beckend/followers","following_url":"https://api.github.com/users/beckend/following{/other_user}","gists_url":"https://api.github.com/users/beckend/gists{/gist_id}","starred_url":"https://api.github.com/users/beckend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beckend/subscriptions","organizations_url":"https://api.github.com/users/beckend/orgs","repos_url":"https://api.github.com/users/beckend/repos","events_url":"https://api.github.com/users/beckend/events{/privacy}","received_events_url":"https://api.github.com/users/beckend/received_events","type":"User","site_admin":false},"created_at":"2016-10-13T07:08:58Z","updated_at":"2016-10-13T07:08:58Z","body":"Let me know how you want to proceed."}}
{"actor":{"display_login":"beckend"}}