Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass html attributes to styled component with render function? #17

Open
GetBitOutdoors opened this issue Jun 6, 2022 · 1 comment

Comments

@GetBitOutdoors
Copy link

GetBitOutdoors commented Jun 6, 2022

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)?

@plexus
Copy link
Member

plexus commented Aug 10, 2022

Have a look at what we're doing in #13 . Does that solve your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants