mirror of https://github.com/status-im/reagent.git
Avoid warnings about unknown props in new React
This commit is contained in:
parent
42ba1662cb
commit
8d35b1f29e
|
@ -31,14 +31,15 @@
|
||||||
save #(let [v (-> @val str clojure.string/trim)]
|
save #(let [v (-> @val str clojure.string/trim)]
|
||||||
(if-not (empty? v) (on-save v))
|
(if-not (empty? v) (on-save v))
|
||||||
(stop))]
|
(stop))]
|
||||||
(fn [props]
|
(fn [{:keys [id class placeholder]}]
|
||||||
[:input (merge props
|
[:input {:type "text" :value @val
|
||||||
{:type "text" :value @val :on-blur save
|
:id id :class class :placeholder placeholder
|
||||||
|
:on-blur save
|
||||||
:on-change #(reset! val (-> % .-target .-value))
|
:on-change #(reset! val (-> % .-target .-value))
|
||||||
:on-key-down #(case (.-which %)
|
:on-key-down #(case (.-which %)
|
||||||
13 (save)
|
13 (save)
|
||||||
27 (stop)
|
27 (stop)
|
||||||
nil)})])))
|
nil)}])))
|
||||||
|
|
||||||
(def todo-edit (with-meta todo-input
|
(def todo-edit (with-meta todo-input
|
||||||
{:component-did-mount #(.focus (r/dom-node %))}))
|
{:component-did-mount #(.focus (r/dom-node %))}))
|
||||||
|
|
Loading…
Reference in New Issue