Fork me on GitHub
#reagent
<
2016-12-22
>
puzzler08:12:50

In my reagent front-end, coded with cursors, using value on the cursor to read, and onChange on the cursor to write, the text entry fields are sluggish to type in. I don't have many components, but the text field relies on cursors built dynamically from cursors built dynamically from cursors, about 4 levels deep from the root. Why so sluggish? Is there a significant delay introduced by each cursor propagation so the round-trip of 8 hops is causing a slowdown? Something else?

pesterhazy08:12:52

@puzzler there are known issues with reagent and input field lag, unfortunately

pesterhazy08:12:30

a workaround might be to store input field data in a local atom and sync that atom with your cursor

joshkh13:12:02

does anyone know why my component lifecycle functions return nil when i call reagent/props? If I log this to the console i can see props in the props: obj attribute

(defn constraint []
  "Creates a button group that represents a query constraint."
  (create-class
    {:component-did-update (fn [this new-argv]
                             ; TODO why is (reagent/props this) returning nil?
                             (.log js/console "this" this) ; I can see props in the js obj
                             (.log js/console "props" (reagent/props this)))
     :component-did-mount  (fn [this]
                             ; TODO why is (reagent/props this) returning nil?
                             (.log js/console "this" this) ; I can see props in the js obj
                             (.log js/console "props" (reagent/props this)))
     :reagent-render       (fn [& {:keys [lists model path value op on-change]}]
                             [:div...

joshkh14:12:58

(i'm mounting my components like [my-component :path "something" :op "contains"])

joshkh14:12:41

(apply hash-map (drop 1 (reagent/argv this))) gets me where i want to be but maybe i'm missing something?