Reagent input not updating Reagent input not updating reactjs reactjs

Reagent input not updating


I turned out to be pretty easy - the "component" function can return not a template, but a function returning template. This way the outer function will be executed only once (and we can put let there), and inner will be executed on every re-render:

(defn new-user []  (let [v (atom "")]    ; The returned function will be called on every re-render.    (fn []      [:div       [:input {:type "text"                :value @v                :on-change (fn [evt]                             (reset! v (-> evt .-target .-value)))}]])))