{"action":"created","issue":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/11929","repository_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped","labels_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/11929/labels{/name}","comments_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/11929/comments","events_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/11929/events","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/issues/11929","id":182506321,"number":11929,"title":"Breaking change to React StatelessComponent definition","user":{"login":"janslow","id":1253367,"avatar_url":"https://avatars.githubusercontent.com/u/1253367?v=3","gravatar_id":"","url":"https://api.github.com/users/janslow","html_url":"https://github.com/janslow","followers_url":"https://api.github.com/users/janslow/followers","following_url":"https://api.github.com/users/janslow/following{/other_user}","gists_url":"https://api.github.com/users/janslow/gists{/gist_id}","starred_url":"https://api.github.com/users/janslow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janslow/subscriptions","organizations_url":"https://api.github.com/users/janslow/orgs","repos_url":"https://api.github.com/users/janslow/repos","events_url":"https://api.github.com/users/janslow/events{/privacy}","received_events_url":"https://api.github.com/users/janslow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-12T11:54:02Z","updated_at":"2016-10-12T12:10:45Z","closed_at":null,"body":"- [x] I tried using the latest `xxxx/xxxx.d.ts` file in this repo and had problems.\r\n- [x] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript\r\n- [x] I have a question that is inappropriate for [StackOverflow](https://stackoverflow.com/).  (Please ask any appropriate questions there).\r\n- [x] I want to talk about `react/index.d.ts`. (on the types-2.0 branch)\r\n  - The authors of that type definition are cc/ @aozgaa \r\n\r\nUsing `typescript@2.0.3` with `strictNullChecks=true`.\r\n\r\nAfter updating from `@types/react@0.14.40` to `0.14.41` (PR #11912 from @donaldpipowitch), I've started getting errors on code which worked before:\r\n\r\nFor example,\r\n```bash\r\n$ tsc -p .\r\nsrc/app/test.tsx(9,7): error TS2605: JSX element type 'ReactElement<any> | null' is not a constructor function for JSX elements.\r\n  Type 'null' is not assignable to type 'ElementClass'.\r\n```\r\n\r\n```tsx\r\nimport * as React from 'react';\r\nimport { StatelessComponent } from 'react';\r\n\r\nconst ElementA: StatelessComponent<any> = (props: {}) => (<div />);\r\n\r\nfunction ElementB(props: {}): JSX.Element {\r\n  return (\r\n    <div>\r\n      <ElementA />\r\n    </div>\r\n  );\r\n}\r\n```\r\n\r\nIt works fine if I use `createElement(ElementA, {})` instead of the TSX form."},"comment":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/comments/253196313","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/issues/11929#issuecomment-253196313","issue_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/11929","id":253196313,"user":{"login":"donaldpipowitch","id":1152805,"avatar_url":"https://avatars.githubusercontent.com/u/1152805?v=3","gravatar_id":"","url":"https://api.github.com/users/donaldpipowitch","html_url":"https://github.com/donaldpipowitch","followers_url":"https://api.github.com/users/donaldpipowitch/followers","following_url":"https://api.github.com/users/donaldpipowitch/following{/other_user}","gists_url":"https://api.github.com/users/donaldpipowitch/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldpipowitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldpipowitch/subscriptions","organizations_url":"https://api.github.com/users/donaldpipowitch/orgs","repos_url":"https://api.github.com/users/donaldpipowitch/repos","events_url":"https://api.github.com/users/donaldpipowitch/events{/privacy}","received_events_url":"https://api.github.com/users/donaldpipowitch/received_events","type":"User","site_admin":false},"created_at":"2016-10-12T12:10:45Z","updated_at":"2016-10-12T12:10:45Z","body":"Seems to work for me in a quick test:\r\n\r\n```typescript\r\nimport React, { StatelessComponent } from 'react';\r\n\r\nconst ElementA: StatelessComponent<any> = (props: {}) => (<div />);\r\n\r\nfunction ElementB(props: {}): JSX.Element {\r\n  return (\r\n    <div>\r\n      <ElementA />\r\n    </div>\r\n  );\r\n}\r\n```\r\n\r\n```json\r\n{\r\n  \"compilerOptions\": {\r\n    \"target\": \"es6\",\r\n    \"moduleResolution\": \"node\",\r\n    \"experimentalDecorators\": true,\r\n    \"allowSyntheticDefaultImports\": true,\r\n    \"noImplicitAny\": true,\r\n    \"noImplicitReturns\": true,\r\n    \"noImplicitThis\": true,\r\n    \"strictNullChecks\": false,\r\n    \"jsx\": \"react\"\r\n  },\r\n  \"exclude\": [\r\n    \"node_modules\"\r\n  ]\r\n}\r\n```"}}
{"actor":{"display_login":"donaldpipowitch"}}