Skip to content

Instantly share code, notes, and snippets.

@qbg
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qbg/9295942 to your computer and use it in GitHub Desktop.
Save qbg/9295942 to your computer and use it in GitHub Desktop.
Potential dom/input weirdness in Om 0.5.0
(ns test.core
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]))
(enable-console-print!)
(def app-state (atom {:a 1}))
(defn demo
[app owner]
(reify
om/IRender
(render [_]
;; This acts like an uncontrolled component somehow
;; Using js/React.DOM.input instead makes it act like
;; a controlled component, as expected.
(dom/input
#js {:type "text"
:value "Hello"
:onChange (fn [_] nil)}))))
(om/root demo app-state {:target (. js/document (getElementById "app"))})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment