mirror of https://github.com/status-im/reagent.git
Make NativeWrapper thinner
This commit is contained in:
parent
2a74cbb144
commit
158fca953b
|
@ -14,7 +14,7 @@
|
||||||
from a tag name."}
|
from a tag name."}
|
||||||
re-tag #"([^\s\.#]+)(?:#([^\s\.#]+))?(?:\.([^\s#]+))?")
|
re-tag #"([^\s\.#]+)(?:#([^\s\.#]+))?(?:\.([^\s#]+))?")
|
||||||
|
|
||||||
(deftype NativeWrapper [comp])
|
(deftype NativeWrapper [])
|
||||||
|
|
||||||
|
|
||||||
;;; Common utilities
|
;;; Common utilities
|
||||||
|
@ -221,9 +221,10 @@
|
||||||
(.' js/React createElement c jsprops)))
|
(.' js/React createElement c jsprops)))
|
||||||
|
|
||||||
(defn adapt-react-class [c]
|
(defn adapt-react-class [c]
|
||||||
(NativeWrapper. #js{:name c
|
(doto (NativeWrapper.)
|
||||||
:id nil
|
(.! :name c)
|
||||||
:class nil}))
|
(.! :id nil)
|
||||||
|
(.! :class nil)))
|
||||||
|
|
||||||
(def tag-name-cache #js{})
|
(def tag-name-cache #js{})
|
||||||
|
|
||||||
|
@ -283,7 +284,7 @@
|
||||||
(assoc v 0 (subs n (inc pos)))])))
|
(assoc v 0 (subs n (inc pos)))])))
|
||||||
|
|
||||||
(instance? NativeWrapper tag)
|
(instance? NativeWrapper tag)
|
||||||
(native-element (.-comp tag) v 1)
|
(native-element tag v 1)
|
||||||
|
|
||||||
:else (reag-element tag v))))
|
:else (reag-element tag v))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue