From c030cf72660a6069e1974e3afce2c1010c924029 Mon Sep 17 00:00:00 2001 From: Dan Holmsand Date: Mon, 1 Dec 2014 14:27:51 +0100 Subject: [PATCH] Fix mount ordering to be more robust --- src/reagent/impl/batching.cljs | 4 ++-- src/reagent/impl/component.cljs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/reagent/impl/batching.cljs b/src/reagent/impl/batching.cljs index 31ad329..bd9fb57 100644 --- a/src/reagent/impl/batching.cljs +++ b/src/reagent/impl/batching.cljs @@ -27,8 +27,8 @@ fake-raf)))) (defn compare-mount-order [c1 c2] - (- (.' c2 :cljsMountOrder) - (.' c1 :cljsMountOrder))) + (- (.' c1 :cljsMountOrder) + (.' c2 :cljsMountOrder))) (defn run-queue [a] ;; sort components by mount order, to make sure parents diff --git a/src/reagent/impl/component.cljs b/src/reagent/impl/component.cljs index 483e09c..e76fbdf 100644 --- a/src/reagent/impl/component.cljs +++ b/src/reagent/impl/component.cljs @@ -105,7 +105,7 @@ (this-as c (f c (.' oldprops :argv)))) - :componentDidMount + :componentWillMount (fn [] (this-as c (.! c :cljsMountOrder (batch/next-mount-count)) @@ -145,7 +145,7 @@ (or wrap (default-wrapper f))))) (def obligatory {:shouldComponentUpdate nil - :componentDidMount nil + :componentWillMount nil :componentWillUnmount nil}) (def dash-to-camel (util/memoize-1 util/dash-to-camel))