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
Additional context (optional)
This is needed for components that are made with React.forwardRef as the return type of that function specifically makes use of PropsWithoutRef and just using Omit<P, 'ref'> does not satisfy React types. Without it in preact/compat, the prop simply becomes any for React components typed with this.
Describe the feature you'd love to see
preact/compat/src/index.d.ts
is missingPropsWithoutRef
.React's type:
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/05094b6df4fb6f4404333725f13d63dd8aabeb34/types/react/index.d.ts#L826
Additional context (optional)
This is needed for components that are made with
React.forwardRef
as the return type of that function specifically makes use ofPropsWithoutRef
and just usingOmit<P, 'ref'>
does not satisfy React types. Without it inpreact/compat
, the prop simply becomesany
for React components typed with this.In the repro below,
SlButton
andSlIcon
do not get proper type checking and will accept any prop.https://stackblitz.com/edit/vitejs-vite-yhasfk?file=tsconfig.json,src%2Fapp.tsx
The text was updated successfully, but these errors were encountered: