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

Tailwind CSS: adding `className` to components

$
0
0

Hi there !

I’m trying to use tailwind CSS with React Native. What is the best way to wrap components.

Unfortunately, I cannot find a simple way to extend types with “className”… Maybe this could be done on the jsx setup ? And then, no wrapping at all is needed anymore.

// This does not compile: type spreading only works for objects, .
type styled<'a> = {...'a, className?: string}

@module("nativewind")
external styled: React.component<'a> => React.component<styled<'a>> = "styled"

module Image = {
  let make = styled(ReactNative.Image.make)
}

Viewing all articles
Browse latest Browse all 2592

Trending Articles