This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-16
Channels
- # aleph (1)
- # announcements (3)
- # babashka (24)
- # beginners (333)
- # clj-kondo (36)
- # cljs-dev (11)
- # clojure (75)
- # clojure-italy (3)
- # clojure-uk (15)
- # clojurescript (31)
- # core-logic (18)
- # cursive (2)
- # data-science (3)
- # datomic (1)
- # events (1)
- # fulcro (13)
- # graalvm (2)
- # jobs (1)
- # kaocha (2)
- # malli (1)
- # overtone (6)
- # re-frame (7)
- # reagent (17)
- # rewrite-clj (3)
- # shadow-cljs (10)
- # sql (9)
- # vim (1)
There is a new library wrapping the material-ui
Otherwise you might need re-frame quickly to manage state, but for small apps reagent is fine with the ratom acting like your hook
https://github.com/reagent-project/reagent/blob/master/doc/examples/material-ui.md
cljs.user=> (clojure.string/replace "5444427007" #"(\d..)(\d..)(\d.)(\d.)" #(str "(" %2 ")" %3 " " %4 " " %5))
"(544)442 70 07"
this works on http://clojurescript.net
but same code doesn't work on reagent
[:span.phone (clojure.string/replace "5444427007" #"(\d..)(\d..)(\d.)(\d.)" #(str "(" %2 ")" %3 " " %4 " " %5))]
it returns ()
but if i do
`[:span.phone (clojure.string/replace "5444427007" #"(\d..)(\d..)(\d.)(\d.)" #(str "(" %1 ")" %3 " " %4 " " %5))]
it returns (["5444427007" "544" "442" "70" "07"])
http://clojurescript.net/ has CLJS 1.7.45 You can try using https://clojurescript.io/ since it has a bit newer version - 1.8.40.
Hi, does someone have a good example of how to manage state in a reagent app? I was trying reagent some days ago. I was trying to keep all the functions that updated the state or deref it in just one place. ingredient-picker
on-click feels weird
Because it deals with this exact problem of handling global state. Just read its README: https://github.com/day8/re-frame/blob/master/README.md