This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-29
Channels
- # announcements (4)
- # architecture (1)
- # beginners (113)
- # boot (17)
- # calva (40)
- # cider (9)
- # clara (1)
- # cljs-dev (21)
- # cljsrn (21)
- # clojure (47)
- # clojure-dev (8)
- # clojure-europe (2)
- # clojure-italy (46)
- # clojure-nl (10)
- # clojure-spec (1)
- # clojure-turkiye (1)
- # clojure-uk (46)
- # clojurescript (102)
- # core-async (21)
- # cursive (35)
- # data-science (1)
- # datomic (7)
- # emacs (2)
- # graphql (1)
- # lumo (15)
- # nrepl (4)
- # nyc (1)
- # off-topic (5)
- # overtone (3)
- # pathom (10)
- # quil (6)
- # re-frame (30)
- # reagent (7)
- # reitit (33)
- # rewrite-clj (1)
- # shadow-cljs (37)
- # spacemacs (73)
- # test-check (3)
- # testing (2)
- # vim (59)
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
ok thanks!
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.
(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.