Fork me on GitHub

is it a convention to use CamelCase for reagent components?


@ackerleytng components in reagent are normal functions so IMO they should be in kebab-case


I’ve also seen the convention of tacking on -ui for functions intended to be used as reagent components.


That said, I’ve come to personally favour MyComponent … reagent components at the point of use are not really meaningfully the same thing as a clojure function, and for me there’s a pleasing brain thing of how well it maps to the JSX convention of camel casing.

👍 4

(that is, components get used as [MyComponent {:foo "bar"} [:p "etc"]], which if you squint looks like invocation but I think it’s important to have some kind of easy signal that this function produces hiccup).


ui prefix or suffix is good idea because sooner or later you'll have problem with items vs ui-items where items is list of items from subscription and ui-items is component handling render of items.

[ui-items items]
It recomended way of naming in fulcro and can work well in reagent app too.

👍 4