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
node_modules/preact/compat/src/index.d.ts:140:19 - error TS2430: Interface 'ForwardRefExoticComponent<P>' incorrectly extends interface 'FunctionComponent<P>'.
Types of property 'defaultProps' are incompatible.
Type 'Partial<P> | undefined' is not assignable to type 'Partial<P>'.
Type 'undefined' is not assignable to type 'Partial<P>'.
140 export interface ForwardRefExoticComponent<P>
~~~~~~~~~~~~~~~~~~~~~~~~~
It's complaining that FunctionComponent<P> in src/index.d.ts has defaultProps?: Partial<P> but ForwardRefExoticComponent<P> in compat/src/index.d.ts (added at b55567f) has defaultProps?: Partial<P> | undefined instead of defaultProps?: Partial<P>.
Describe the bug
preact@10.14.1
compiles when TypeScript'sexactOptionalPropertyTypes
tsconfig setting is enabled.preact@10.15.0
doesn't:It's complaining that
FunctionComponent<P>
in src/index.d.ts hasdefaultProps?: Partial<P>
butForwardRefExoticComponent<P>
in compat/src/index.d.ts (added at b55567f) hasdefaultProps?: Partial<P> | undefined
instead ofdefaultProps?: Partial<P>
.To Reproduce
Expected behavior
Ideally, preact would continue to compile with this TypeScript configuration.
The text was updated successfully, but these errors were encountered: