Wrap each child
I would like to wrap each child in an element.
For example I have a list element and I wand ever child element to be wrapped in a
li
element. What's the proper way of doing this? I can do it like this with the children
helper function, but is this a good way of doing it? Should I try to avoid this situation?
8 Replies
this is more or less the correct way to do it except you should call
toArray
in the jsx otherwise the children may not update
why not just do
there is no
toArray
on the children propoh interesting. so you have to do a derived signal in order to type correctly? I don't quite understand how that works
the
children
helper does that
otherwise evaluating props.children
could give you anythingah, I didn't see that in the original code, just glossed over it
Thanks! Would I be correct in assuming that everything needs recalculated for every new child?
the new child needs to be created but everything else should be reused