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)]
|
||||
(if-not (empty? v) (on-save v))
|
||||
(stop))]
|
||||
(fn [props]
|
||||
[:input (merge props
|
||||
{:type "text" :value @val :on-blur save
|
||||
:on-change #(reset! val (-> % .-target .-value))
|
||||
:on-key-down #(case (.-which %)
|
||||
13 (save)
|
||||
27 (stop)
|
||||
nil)})])))
|
||||
(fn [{:keys [id class placeholder]}]
|
||||
[:input {:type "text" :value @val
|
||||
:id id :class class :placeholder placeholder
|
||||
:on-blur save
|
||||
:on-change #(reset! val (-> % .-target .-value))
|
||||
:on-key-down #(case (.-which %)
|
||||
13 (save)
|
||||
27 (stop)
|
||||
nil)}])))
|
||||
|
||||
(def todo-edit (with-meta todo-input
|
||||
{:component-did-mount #(.focus (r/dom-node %))}))
|
||||
|
|
Loading…
Reference in New Issue