A minimalistic ClojureScript interface to React.js
ruben.hamers 2020-06-13T06:09:19.157600Z

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!

ruben.hamers 2020-06-13T06:09:42.157800Z

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))}
I tried using r/current-component and r/children but children is coming back as null

lilactown 2020-06-13T22:04:18.159700Z

children are passed as arguments

lilactown 2020-06-13T22:04:43.160200Z

so assuming you're rendering like [container {} [child1] [child2]]

lilactown 2020-06-13T22:05:15.160900Z

the arguments passed to container will be:

(defn container [props child1 child2]

lilactown 2020-06-13T22:05:39.161400Z

you can use [props & children] to refer to a variable number of children