-
Notifications
You must be signed in to change notification settings - Fork 473
Description
Continuing the discussion from here #5711
Currently, we ship one large dom props type that we say all lowercase JSX elements have. We try to fit as much as possible into that one, to cover the props of all existing element types. However, in reality, different dom elements may have different props.
Typically, there's a set of base dom props that all elements have. Then various elements have various additional props. Sometimes the specialized props overlap, sometimes they don't.
@cristianoc asked how the types would generally look for this. I think we can piggy back on TS here. This is how TS defines the same thing: https://github.com/microsoft/TypeScript/blob/main/lib/lib.dom.d.ts#L6916
That's an example for HTMLInputElement, and there are types for all the different elements in there. So, there's a base HTMLElement that holds all common props for all elements. That's then extended with the specialized props for each element.
cc @mattdamon108 @cknitt