Fork me on GitHub
#reagent
<
2019-11-16
>
David Pham00:11:35

There is a new library wrapping the material-ui

David Pham00:11:37

Otherwise you might need re-frame quickly to manage state, but for small apps reagent is fine with the ratom acting like your hook

metehan18:11:11

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 ()

metehan18:11:17

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"])

p-himik18:11:25

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.

metehan18:11:56

thank you it helped

dharrigan22:11:17

Anyone using reagent with antd (and ant-man?)

dharrigan22:11:37

can't figure out how to get "on-row" for a table to work 😞

nmkip23:11:43

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

p-himik06:11:04

You may find re-frame suitable for your needs.

nmkip12:11:32

Yes? why?

p-himik12:11:40

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

p-himik12:11:18

Also, there's a separate channel #re-frame in case you'll have some questions.

nmkip13:11:37

Thanks, I'll read it