Closed
Description
Using @types/react
:
class Poisoned extends React.Component<{}, {}> {
}
const obj: Object = {};
let p = <Poisoned {...obj} />;
let y = <Poisoned />;
Expected: no errors
Actual:
foo.tsx(6,9): error TS2324: Property 'constructor' is missing in type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & {} & { children?: ReactNode; }'. foo.tsx(6,9): error TS2324: Property 'hasOwnProperty' is missing in type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & {} & { children?: ReactNode; }'. foo.tsx(6,9): error TS2324: Property 'isPrototypeOf' is missing in type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & {} & { children?: ReactNode; }'. foo.tsx(6,9): error TS2324: Property 'propertyIsEnumerable' is missing in type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & {} & { children?: ReactNode; }'. foo.tsx(6,9): error TS2324: Property 'toLocaleString' is missing in type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & {} & { children?: ReactNode; }'. foo.tsx(6,9): error TS2324: Property 'toString' is missing in type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & {} & { children?: ReactNode; }'. foo.tsx(6,9): error TS2324: Property 'valueOf' is missing in type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & {} & { children?: ReactNode; }'.
Note that these errors are reported at the second instantiation
Originally discussed at #10430, repro reduced from a codebase from @Strate