mirror of https://github.com/status-im/reagent.git
Get rid of pesky React warning in demo
This commit is contained in:
parent
60427a3231
commit
26392052b4
|
@ -2,16 +2,15 @@
|
|||
(:require [reagent.core :as r]
|
||||
[reagent.debug :refer-macros [dbg println]]))
|
||||
|
||||
(defn demo-component []
|
||||
(let [showing (r/atom true)]
|
||||
(fn [{:keys [comp src complete no-heading]}]
|
||||
(defn demo-component [{:keys [comp src complete no-heading]}]
|
||||
(r/with-let [showing (r/atom true)]
|
||||
[:div
|
||||
(when comp
|
||||
[:div.demo-example.clearfix
|
||||
[:a.demo-example-hide {:on-click (fn [e]
|
||||
(.preventDefault e)
|
||||
(swap! showing not)
|
||||
false)}
|
||||
nil)}
|
||||
(if @showing "hide" "show")]
|
||||
(when-not no-heading
|
||||
[:h3.demo-heading "Example "])
|
||||
|
@ -25,4 +24,4 @@
|
|||
(when-not no-heading
|
||||
[:h3.demo-heading "Source"])
|
||||
src]
|
||||
[:div.clearfix]))])))
|
||||
[:div.clearfix]))]))
|
||||
|
|
Loading…
Reference in New Issue