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
No error. The two are supposed to be equivalent. The code works in runtime.
Actual behavior:
Compile-time error is reported on line 7:
Type 'U & Pick<ComponentProps<T>, Exclude<keyof ComponentProps<T>, keyof U>> & Partial<U> & { children?: ReactNode; }' is not assignable to type 'IntrinsicAttributes & LibraryManagedAttributes<T, any>'.
Type 'U & Pick<ComponentProps<T>, Exclude<keyof ComponentProps<T>, keyof U>> & Partial<U> & { children?: ReactNode; }' is not assignable to type 'LibraryManagedAttributes<T, any>'.
Playground Link:
I created a StackBlitz demo, but it refuses to use the locally installed version of TypeScript, so there is an unrelated error reported for ...defaults.
The text was updated successfully, but these errors were encountered:
TypeScript Version: 3.3.0-dev.20181229
Relevant types:
@types/[email protected]
,@types/[email protected]
Search Terms:
Code
However, when we use
React.createElement
directly:the type-checking passes successfully.
Expected behavior:
No error. The two are supposed to be equivalent. The code works in runtime.
Actual behavior:
Compile-time error is reported on line 7:
Playground Link:
I created a StackBlitz demo, but it refuses to use the locally installed version of TypeScript, so there is an unrelated error reported for
...defaults
.The text was updated successfully, but these errors were encountered: