-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript - react component requires placeholder, onPointerEnterCapture & onPointerLeaveCapture properties #30
Comments
This issue only occurs for Nextjs 13.5 and not for 13.4. Can someone please look into this? |
I'll try to investigate the issue. I doubt this has to do anything with Nextjs, same happens with Vite. If I find a solution I'll open a PR or just post my findings here. |
Narrowed it further, the issue is related to types/react. It occurs on 18.2.43 but not on version 18.2.42 |
Thanks @oddgr8, this actually helped a lot to find the issue faster. Based the version diff, it seems that the I think it comes from this pr: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/67170/commits For the I also found this discussion about it: DefinitelyTyped/DefinitelyTyped#69006 |
Awesome! I'll try more to get a better solution and raise a PR if I can. Thanks! |
Sure! You can also add the properties back to the declaration if you want: declare module "react" {
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
placeholder?: string | undefined;
}
interface DOMAttributes<T> {
onPointerEnterCapture?: React.PointerEventHandler<T> | undefined;
onPointerLeaveCapture?: React.PointerEventHandler<T> | undefined;
}
} |
It'd be awesome to get a PR for this. If not, I can work on it in a few weeks. It'll have to be made to the v4 branch https://github.com/AlfieJones/theme-toggles/tree/v4 I'm planning on getting v5 finished up this summer which is what the main branch is currently showing |
Thanks for the info. I'll give it a chance when I find some time. |
Hi, first of all, thanks for your work in this library, the toggles are great!
I'm using the react toggles and I've noticed that typescript complains about missing properties
placeholder
,onPointerEnterCapture
andonPointerLeaveCapture
.Is this an issue with the types? Except if I'm missing something, I wouldn't expect those in here.
The text was updated successfully, but these errors were encountered: