Fork me on GitHub
#reagent
<
2018-04-23
>
eoliphant12:04:54

so is there any ‘consensus’ lol on [{props-map} & children], [props ... & children]

pesterhazy12:04:02

How do you mean?

eoliphant12:04:30

well I’ve seen articles that are more in favor of a stricter [my-component {:aprop "1"} ..] in more react style convention vs lots of code/examples with tons of components whose args are just ‘normal’ clojure variations was just wondering if there’s a preponderance of opinion in terms of style one way or the other for reagent components

justinlee14:04:35

@eoliphant In my opinion you should just write what is most natural. The only issue that arises is when you do interop with higher ordered components—then you must have the props map. Reagent went out of its way to make the render functions look and feel like normal functions so might as well take advantage of that. I use both styles where appropriate. If the first arg is not a map then reagent just sets prop to be empty.

eoliphant14:04:46

yeah, I find myself doing a bit of both, was just wondering what is ‘best’ lol, and it is kind of nice that they can be more ‘natural’ clojure. I do tend to use the map/props style more for form components

justinlee15:04:14

Yes me too.