Closed borkdude closed 9 years ago
I think reagent wants components to be functions, so that it can re-evaluate them when atoms change:
(def show? (atom true))
(defn show-div []
[:div (str @show?)
[:button {:on-click
(fn [e] (swap! show? not))}
"swap"]])
(defn ^:export run []
(reagent/render-component
[show-div]
(.-body js/document)))
The following does not seem to work. I'm fairly new to Reagent, so my question is, should it work?