ornament
ornament copied to clipboard
How to pass html attributes to styled component with render function?
This should work for a single value.
(defstyled myelem :div
([html-attr-value]
^{:html-attr-key html-attr-value} ; attrs for outer html div
[:<>
[:h1 "Hello World"]]))
(myelem "val")
=> <div html-attr-key="val"><h1>Hello World</h1></div>
But how do you pass a map of html attr values to outer (parent div) html element (when render function is receiving input)?
Have a look at what we're doing in #13 . Does that solve your issue?