Make NativeWrapper thinner

This commit is contained in:
Dan Holmsand 2015-10-07 23:02:55 +02:00
parent 2a74cbb144
commit 158fca953b
1 changed files with 6 additions and 5 deletions

View File

@ -14,7 +14,7 @@
from a tag name."}
re-tag #"([^\s\.#]+)(?:#([^\s\.#]+))?(?:\.([^\s#]+))?")
(deftype NativeWrapper [comp])
(deftype NativeWrapper [])
;;; Common utilities
@ -221,9 +221,10 @@
(.' js/React createElement c jsprops)))
(defn adapt-react-class [c]
(NativeWrapper. #js{:name c
:id nil
:class nil}))
(doto (NativeWrapper.)
(.! :name c)
(.! :id nil)
(.! :class nil)))
(def tag-name-cache #js{})
@ -283,7 +284,7 @@
(assoc v 0 (subs n (inc pos)))])))
(instance? NativeWrapper tag)
(native-element (.-comp tag) v 1)
(native-element tag v 1)
:else (reag-element tag v))))