Closed
Description
Moved from: microsoft/TypeScript#18134
Encountering errors using webpack
when importing ES6 classes that extend React.Component
into TSX. Entry file is app.jsx
.
Compiler outputs working code, and current solution is adding ignoreDiagnostics: [2605, 2607]
to ts-loader
options in Webpack config.
TypeScript Version: 2.4.2
ts-loader Version: 2.3.4
Code
https://github.com/alecmerdler/tsx-jsx
Expected behavior:
tsc
with no errorswebpack
with no errors
Actual behavior:
tsc
: no errorswebpack
:error TS2605: JSX element type 'Hello' is not a constructor function for JSX elements. Property 'setState' is missing in type 'Hello'.
and
error TS2607: JSX element class does not support attributes because it does not have a 'props' property.
Metadata
Metadata
Assignees
Labels
No labels