Closed agzam closed 4 years ago
You can just return a seq directly:
(def content
(list
[:li "one"]
[:li "two"]
[:li "three"]))
Thank you James. Somehow trying that didn't occur to me.
When targeting react w/ reagent, something like [:<> child1 child2]
and (list child1 child2)
represent the same DOM elements but they are treated differently by React - the former doesn't require a unique key for each child, whereas the latter does. Supporting :<>
on the server (in this lib) would make it easier to write code that works in both environments.
rum can be used to render react-specific hiccups (with :<>
fragments) on server side via rum.core/render-html
.
Would it be possible to add a feature similar to Re-agent's support for React Fragments. So it is possible to do things like this:
Currently you have to do something like:
Which is a bit difficult, now the caller has to know about the structure of sub-component