Fork me on GitHub
#reagent
<
2016-04-20
>
lwhorton13:04:30

are there some special semantics with regards to ‘raw’ react components that I’m not understanding? I cannot get reagent to re-render this:

(defn date-picker []
  (let [component (js/React.createClass klass)
        state (atom (init-state))]
    (fn []
      (reagent/create-element 
        component 
        (clj->js {:state @state
                  :toggle #(swap! state toggle-picker-state)})))))

lwhorton13:04:31

I would think so long as @state is derefd somewhere inside the inner render I would get a re-render on swap!?

lwhorton13:04:06

-1 for being dumb, atom != reagent/atom

hemingward17:04:53

I think we have all been burnt by that at some point @lwhorton! I know I have. Thrice!

gadfly36117:04:02

I cant even count how many times i have... My newest mistake is doing reagent/ratom

conaw23:04:23

Anyone here using golden-layout, or interested in porting it to reagent? https://github.com/deepstreamIO/golden-layout

mikethompson23:04:21

we get some of that via re-com

mikethompson23:04:23

re-com might not be as sophisticated as golden, but I'm guessing it will be easier, quicker and nicer to use.