mirror of https://github.com/status-im/reagent.git
Deprecate component-path in core ns
This commit is contained in:
parent
ad3b6af57e
commit
106e5d86ca
|
@ -83,8 +83,8 @@
|
||||||
(dom/unmount-component-at-node container))
|
(dom/unmount-component-at-node container))
|
||||||
|
|
||||||
;; For backward compatibility
|
;; For backward compatibility
|
||||||
(def ^{:deprecated true} as-component as-element)
|
(def ^{:deprecated "0.10.0"} as-component as-element)
|
||||||
(def ^{:deprecated true} render-component render)
|
(def ^{:deprecated "0.10.0"} render-component render)
|
||||||
|
|
||||||
(defn force-update-all
|
(defn force-update-all
|
||||||
"Force re-rendering of all mounted Reagent components. This is
|
"Force re-rendering of all mounted Reagent components. This is
|
||||||
|
@ -390,8 +390,9 @@
|
||||||
(util/make-partial-fn f args))
|
(util/make-partial-fn f args))
|
||||||
|
|
||||||
(defn component-path
|
(defn component-path
|
||||||
;; Try to return the path of component c as a string.
|
"Try to return the path of component c as a string.
|
||||||
;; Maybe useful for debugging and error reporting, but may break
|
Maybe useful for debugging and error reporting, but may break
|
||||||
;; with future versions of React (and return nil).
|
with future versions of React (and return nil)."
|
||||||
|
{:deprecated "0.10.0"}
|
||||||
[c]
|
[c]
|
||||||
(comp/component-path c))
|
(comp/component-path c))
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
[reagent.debug :as debug :refer-macros [dev?]]
|
[reagent.debug :as debug :refer-macros [dev?]]
|
||||||
[reagent.core :as r]
|
[reagent.core :as r]
|
||||||
[reagent.dom.server :as server]
|
[reagent.dom.server :as server]
|
||||||
|
[reagent.impl.component :as comp]
|
||||||
[reagenttest.utils :as u :refer [with-mounted-component]]
|
[reagenttest.utils :as u :refer [with-mounted-component]]
|
||||||
[clojure.string :as string]
|
[clojure.string :as string]
|
||||||
[goog.string :as gstr]
|
[goog.string :as gstr]
|
||||||
|
@ -662,7 +663,7 @@
|
||||||
tc (r/create-class {:display-name "atestcomponent"
|
tc (r/create-class {:display-name "atestcomponent"
|
||||||
:render (fn []
|
:render (fn []
|
||||||
(let [c (r/current-component)]
|
(let [c (r/current-component)]
|
||||||
(reset! a (r/component-path c))
|
(reset! a (comp/component-path c))
|
||||||
[:div]))})]
|
[:div]))})]
|
||||||
(with-mounted-component [tc]
|
(with-mounted-component [tc]
|
||||||
(fn [c]
|
(fn [c]
|
||||||
|
|
Loading…
Reference in New Issue