mirror of
https://github.com/status-im/reagent.git
synced 2025-01-13 21:34:29 +00:00
Rename :component-function to :reagent-render
But keep :component-function as alias for the time being
This commit is contained in:
parent
c862792624
commit
017fa9c106
@ -28,7 +28,7 @@
|
||||
(let [f (.' c :cljsRender)
|
||||
_ (assert (ifn? f))
|
||||
p (.' c :props)
|
||||
res (if (nil? (.' c :componentFunction))
|
||||
res (if (nil? (.' c :reagentRender))
|
||||
(f c)
|
||||
(let [argv (.' p :argv)
|
||||
n (count argv)]
|
||||
@ -118,7 +118,7 @@
|
||||
(this-as c (apply f c args)))
|
||||
f))
|
||||
|
||||
(def dont-wrap #{:cljsRender :render :componentFunction :cljsName})
|
||||
(def dont-wrap #{:cljsRender :render :reagentRender :cljsName})
|
||||
|
||||
(defn dont-bind [f]
|
||||
(if (fn? f)
|
||||
@ -157,8 +157,13 @@
|
||||
(assoc fm :cljsName (fn [] name))
|
||||
fm)))
|
||||
|
||||
(defn wrap-funs [fun-map]
|
||||
(let [render-fun (or (:componentFunction fun-map)
|
||||
(defn wrap-funs [fmap]
|
||||
(let [fun-map (if-some [cf (:componentFunction fmap)]
|
||||
(-> fmap
|
||||
(assoc :reagentRender cf)
|
||||
(dissoc :componentFunction))
|
||||
fmap)
|
||||
render-fun (or (:reagentRender fun-map)
|
||||
(:render fun-map))
|
||||
_ (assert (ifn? render-fun)
|
||||
(str "Render must be a function, not "
|
||||
|
@ -76,7 +76,7 @@
|
||||
self (atom nil)
|
||||
comp (reagent/create-class
|
||||
{:get-initial-state (fn [] {:foo "initial"})
|
||||
:render
|
||||
:reagent-render
|
||||
(fn []
|
||||
(let [this (reagent/current-component)]
|
||||
(reset! self this)
|
||||
|
Loading…
x
Reference in New Issue
Block a user