This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-03
Channels
- # admin-announcements (6)
- # beginners (73)
- # boot (84)
- # cider (9)
- # cljs-edn (5)
- # cljs-site (8)
- # cljsrn (2)
- # clojure (158)
- # clojure-austin (1)
- # clojure-canada (1)
- # clojure-dusseldorf (2)
- # clojure-ireland (1)
- # clojure-russia (45)
- # clojure-sg (2)
- # clojure-uk (28)
- # clojurebridge (2)
- # clojurescript (142)
- # core-async (43)
- # cursive (23)
- # datascript (5)
- # datomic (9)
- # dirac (4)
- # emacs (23)
- # funcool (1)
- # garden (1)
- # hoplon (280)
- # jobs (1)
- # ldnclj (6)
- # leiningen (37)
- # luminus (6)
- # om (30)
- # om-next (1)
- # onyx (6)
- # perun (24)
- # re-frame (10)
- # reagent (20)
- # remote-jobs (1)
- # rethinkdb (2)
- # ring-swagger (4)
- # rum (3)
- # spacemacs (6)
- # untangled (36)
- # yada (5)
@lewix: it should be something which can be turned into a unique string.
unique among siblings
@mikethompson: i tried {:key (str c)} unsuccessfully - and I saw id use before which is not a string
@lewix: what was unsuccessful?
And I didn't say it had to be a string. I said it had to be something that could be turned into a string.
And that it was unique amoung siblings
Does anyone have an explanation for why reagent components move the cursor during deletion? From React docs as long as it’s re-rendering it should keep the cursor position. My input component looks as follows:
As I understand by having the ratom in the closure it should cause the re-render to execute (retaining the cursor position) or is my understanding incorrect?
is it common practice to use doall
when rendering list components, or is that a smell? consider something like
(defn- render-row [row]
(doall (for [it row]
^{:key (:id it)}
[:div {:class s/col}
[render-item it]])))
(defn render-list []
[:div
[:ul
(map-indexed
(fn [idx row]
^{:key idx}
[:li (render-row row)]) rows)]]))
I can’t get the render-row row
to render something unless I force lazy eval with a doall
.. so I suppose reagent doesn’t do any op that would cause the lazy to evaluate?
I was able to set up a reagent component using reactify-component
and create-class
such that :reagent-render
sets up the component and checks the props map to set state. However any change of state get overwritten instantly by that initial props state. Is that just me not using the lifecycle functions properly?
Hi Reagents! I added to cljs-react-material-ui
full support for Reagent. Using Reagent with MaterialUI is now breeze 😉 https://github.com/madvas/cljs-react-material-ui
@lwhorton: it is ok. you can user mapv too.
Hello all, I´m trying re-frame and I implemented the views part like:
(defmulti paginas identity)
(defmethod paginas :pagina-login [] [vlogin/login])
(defmethod paginas :pagina-principal [] [:div "HAHAHA"])
(defmethod paginas :default [] [:div])
(defn mostrar-pagina [id-pagina]
[paginas id-pagina])
(defn pagina []
(let [pagina-ativa (re-frame/subscribe [:pagina-ativa])]
(fn []
[mostrar-pagina @pagina-ativa])))
That render page when I change :pagina-ativa. So, If I want to execute something like setting focus, what is the best way to do in re-frame?@fabrao: this topic has great answers
@hugobessaa: it worked, thanks a lot
@lwhorton: keys are useful when your list is quite dynamic, with items being added to, and removed from, the list quite often.
But if the list is fairly static, then forget keys are just use into
:
(defn render-list []
[:div
(into [:ul] (map (fn [row] [:li (render-row row)]) rows))])