Unfortunately, this doesn’t work because the types for a component can be defined as named function arguments instead of an object:
type styledProps<'a> = {
...'a, // <=== The type 'a is not an object type
className?: string,
}
type component<'props> = Jsx.component<styledProps<'props>>
PS: props type for Elements is not a problem because JsxDOM.domProps already has “className”.