How do you access a components children in reagent?
(defn container [props]
(let [comp (r/current-component)
children (r/children comp)]
[rn/view {:style (merge {:padding 24} (:style props))}
[children]]))
I tried using r/current-component and r/children but children is coming back as nullchildren are passed as arguments
so assuming you're rendering like [container {} [child1] [child2]]
the arguments passed to container
will be:
(defn container [props child1 child2]
,,,)
you can use [props & children]
to refer to a variable number of children