Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

Tailwind CSS: adding `className` to components

$
0
0

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”.


Viewing all articles
Browse latest Browse all 2592

Trending Articles