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))
|
||||
|
||||
;; For backward compatibility
|
||||
(def ^{:deprecated true} as-component as-element)
|
||||
(def ^{:deprecated true} render-component render)
|
||||
(def ^{:deprecated "0.10.0"} as-component as-element)
|
||||
(def ^{:deprecated "0.10.0"} render-component render)
|
||||
|
||||
(defn force-update-all
|
||||
"Force re-rendering of all mounted Reagent components. This is
|
||||
|
@ -390,8 +390,9 @@
|
|||
(util/make-partial-fn f args))
|
||||
|
||||
(defn component-path
|
||||
;; Try to return the path of component c as a string.
|
||||
;; Maybe useful for debugging and error reporting, but may break
|
||||
;; with future versions of React (and return nil).
|
||||
"Try to return the path of component c as a string.
|
||||
Maybe useful for debugging and error reporting, but may break
|
||||
with future versions of React (and return nil)."
|
||||
{:deprecated "0.10.0"}
|
||||
[c]
|
||||
(comp/component-path c))
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
[reagent.debug :as debug :refer-macros [dev?]]
|
||||
[reagent.core :as r]
|
||||
[reagent.dom.server :as server]
|
||||
[reagent.impl.component :as comp]
|
||||
[reagenttest.utils :as u :refer [with-mounted-component]]
|
||||
[clojure.string :as string]
|
||||
[goog.string :as gstr]
|
||||
|
@ -660,10 +661,10 @@
|
|||
(deftest test-component-path
|
||||
(let [a (atom nil)
|
||||
tc (r/create-class {:display-name "atestcomponent"
|
||||
:render (fn []
|
||||
(let [c (r/current-component)]
|
||||
(reset! a (r/component-path c))
|
||||
[:div]))})]
|
||||
:render (fn []
|
||||
(let [c (r/current-component)]
|
||||
(reset! a (comp/component-path c))
|
||||
[:div]))})]
|
||||
(with-mounted-component [tc]
|
||||
(fn [c]
|
||||
(is (seq @a))
|
||||
|
|
Loading…
Reference in New Issue