I’m writing a library that has a detection for a custom data- attribute. I want to have auto-complete enabled for it on HTML elements.
Tried extending HTMLElement, a Method that is used to calculate JSX types but failed to do. it seems like the only way to do so is extending each individual elements in IntrinsicElements, but I want to do it more dynamically. Tried using an override outside with a mapped type to intrinsicElements then having it extend the override, but it ends in a recursive call.
is there a way to achieve it without having to extend each HTML element?
You shouldn’t need to add this to your types as its already supported by html elements. Its a common use case for a lot of libraries.
See the docs here:
https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes