Last active
August 29, 2015 13:56
-
-
Save qbg/9295942 to your computer and use it in GitHub Desktop.
Potential dom/input weirdness in Om 0.5.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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