Closed jd-carroll closed 4 months ago
Just did some additional investigating and I do not see either of those attributes defined in @types/react
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/2f4238e22773624585ec81994bf54ef9873f5e2c/types/react/ts5.0/index.d.ts#L2487-L2488
(which is why those types come up as untyped required attributes)
But how has no one else run into this issue?
Last thing, wouldn't it be better to structure IconType
as:
type IconType = React.ForwardRefExoticComponent<
Omit<React.SVGProps<SVGSVGElement>, 'title' | 'color' | 'size'> & {
title?: string;
color?: string;
size?: string | number;
} & React.RefAttributes<SVGSVGElement>
>;
Hello everyone,
I've submitted a PR #216 that aims to resolve the type error issue highlighted in issue #215 by removing the onPointerEnterCapture and onPointerLeaveCapture from the type declarations, syncing with the recent updates to React's type definitions. I would greatly appreciate any feedback or suggestions on this solution.
Thank you for your time and looking forward to any further discussion!
This is only an issue for "@types/react": "18.2.67"
For a workaround you can downgrade to 18.2.62
- if only React would have been written in TypeScript...
solved #216
I am getting errors from the
IconType
statingonPointerEnterCapture
andonPointerLeaveCapture
are missing. But when I try to add an empty handler I receive DOM errors:My default is to always assume I am doing something wrong... ?
But this is really weird, anyone seen this before?