{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/14558","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/14558/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/14558/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/14558/events","html_url":"https://github.com/Microsoft/TypeScript/issues/14558","id":213119945,"number":14558,"title":"TS files cannot use JSX components declared as a classes in JS/JSX file","user":{"login":"DanielRosenwasser","id":972891,"avatar_url":"https://avatars2.githubusercontent.com/u/972891?v=4","gravatar_id":"","url":"https://api.github.com/users/DanielRosenwasser","html_url":"https://github.com/DanielRosenwasser","followers_url":"https://api.github.com/users/DanielRosenwasser/followers","following_url":"https://api.github.com/users/DanielRosenwasser/following{/other_user}","gists_url":"https://api.github.com/users/DanielRosenwasser/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielRosenwasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielRosenwasser/subscriptions","organizations_url":"https://api.github.com/users/DanielRosenwasser/orgs","repos_url":"https://api.github.com/users/DanielRosenwasser/repos","events_url":"https://api.github.com/users/DanielRosenwasser/events{/privacy}","received_events_url":"https://api.github.com/users/DanielRosenwasser/received_events","type":"User","site_admin":false},"labels":[{"id":113970366,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Bug","name":"Bug","color":"e11d21","default":false},{"id":114001888,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Fixed","name":"Fixed","color":"bfe5bf","default":false},{"id":263347516,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Salsa","name":"Salsa","color":"ff4b20","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/42","html_url":"https://github.com/Microsoft/TypeScript/milestone/42","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/42/labels","id":2409572,"number":42,"title":"TypeScript 2.3.1","description":"","creator":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars3.githubusercontent.com/u/8000722?v=4","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":72,"state":"closed","created_at":"2017-03-24T16:27:56Z","updated_at":"2017-05-22T16:11:45Z","due_on":null,"closed_at":"2017-04-27T16:01:12Z"},"comments":36,"created_at":"2017-03-09T18:09:40Z","updated_at":"2018-02-06T15:20:38Z","closed_at":"2017-04-19T17:06:48Z","author_association":"MEMBER","body":"CC @donataswix\r\n\r\nIt appears that using a React component written as a class in a `.js` file causes some issues.\r\n\r\nStart a project with the following files:\r\n\r\n`tsconfig.json`\r\n \r\n```json\r\n{\r\n  \"compilerOptions\": {\r\n    \"module\": \"es2015\",\r\n    \"target\": \"esnext\",\r\n    \"jsx\": \"react-native\",\r\n    \"strictNullChecks\": true,\r\n    \"allowSyntheticDefaultImports\": true,\r\n    \"allowJs\": true,\r\n    \"lib\": [\r\n      \"es5\",\r\n      \"es6\",\r\n      \"es7\",\r\n      \"es2017\",\r\n      \"dom\"\r\n    ],\r\n    \"outDir\": \"dist\"\r\n  },\r\n  \"include\": [\r\n    \"**/*.ts\",\r\n    \"**/*.tsx\"\r\n  ],\r\n  \"exclude\": [\r\n    \"node_modules\"\r\n  ]\r\n}\r\n\r\n```\r\n\r\n`index.tsx`\r\n\r\n```ts\r\nimport React from 'react';\r\nimport Hello from './hello';\r\n\r\nclass A extends React.Component<void,void> {\r\n  render() {\r\n    return (\r\n      <div>\r\n        <Hello/>\r\n      </div>\r\n    );\r\n  }\r\n}\r\n```\r\n\r\n`hello.js`\r\n\r\n```js\r\nimport React from 'react';\r\n\r\nexport default class Hello extends React.Component {\r\n  render() {\r\n    return <div>Hello</div>;\r\n  }\r\n}\r\n```\r\n\r\n**Expected**: No problems\r\n**Actual**: Error on `<Hello />`: JSX element type 'Hello' does not have any construct or call signatures.\r\n\r\nNote that if you add type arguments to `Component` in `hello.js`, this will actually fix the problem (while creating new ones).\r\n\r\nPotentially related is #13609."},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/363454903","html_url":"https://github.com/Microsoft/TypeScript/issues/14558#issuecomment-363454903","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/14558","id":363454903,"user":{"login":"ssunday","id":3252602,"avatar_url":"https://avatars3.githubusercontent.com/u/3252602?v=4","gravatar_id":"","url":"https://api.github.com/users/ssunday","html_url":"https://github.com/ssunday","followers_url":"https://api.github.com/users/ssunday/followers","following_url":"https://api.github.com/users/ssunday/following{/other_user}","gists_url":"https://api.github.com/users/ssunday/gists{/gist_id}","starred_url":"https://api.github.com/users/ssunday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssunday/subscriptions","organizations_url":"https://api.github.com/users/ssunday/orgs","repos_url":"https://api.github.com/users/ssunday/repos","events_url":"https://api.github.com/users/ssunday/events{/privacy}","received_events_url":"https://api.github.com/users/ssunday/received_events","type":"User","site_admin":false},"created_at":"2018-02-06T15:20:37Z","updated_at":"2018-02-06T15:20:37Z","author_association":"NONE","body":"@danantal Running into this as well. Not on TS `2.6.2`, though. Going to try to upgrade, but it's big jump for the codebase."}}
{"actor":{"display_login":"ssunday"}}