Closed stoeckley closed 6 years ago
How to pass a Semantic component as an "element" in props, like here:
https://react.semantic-ui.com/elements/input#input-example-icon-element
I tried:
[sa/Input {:icon [sa/Icon {:name "cancel" ...}] ... }]
This nesting behavior and ability to pass components as props will probably come up occasionally but I cannot figure out the corresponding cljs syntax for it.
@astoeckley You are looding for reagent/as-element
reagent/as-element
[sa/Input {:icon (reagent/as-element [sa/Icon {:name "cancel"}])}]
thankx!
How to pass a Semantic component as an "element" in props, like here:
https://react.semantic-ui.com/elements/input#input-example-icon-element
I tried:
[sa/Input {:icon [sa/Icon {:name "cancel" ...}] ... }]
This nesting behavior and ability to pass components as props will probably come up occasionally but I cannot figure out the corresponding cljs syntax for it.