Thx for pointing me to re-frame. Spend the past couple of days studying the project, watching some content on youtube and reading the docs. It is very well documented and seems really easy. especially with their client side template which is exactly what I need. thx guys!
kudos ;0
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