You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typeMyComponentProps={name: string;};classMyComponentextendsReact.Component<MyComponentProps,void>{}classMyClass{publicname: string;publicage?: number;}constmy: MyClass={name: "Jack",age: 20};constprops: MyComponentProps={ ...my};// This worksconstc1=<MyComponent{...my}/>;// error TS2322: Property 'age' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<MyComponent> & Readonly<{ children?: ReactNode; }>...'constc2=<MyComponent{...props}/>;// This works
The text was updated successfully, but these errors were encountered:
TypeScript Version: 2.3.2
Code
The text was updated successfully, but these errors were encountered: