From ea021d3b8778f689d44a3546893cdda429be4b29 Mon Sep 17 00:00:00 2001 From: Dan Holmsand Date: Sun, 30 Aug 2015 21:53:23 +0200 Subject: [PATCH] Don't try to unmount on error React gets very confused when there are errors... --- src/reagent/impl/util.cljs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/reagent/impl/util.cljs b/src/reagent/impl/util.cljs index c63ac10..a005fb5 100644 --- a/src/reagent/impl/util.cljs +++ b/src/reagent/impl/util.cljs @@ -108,8 +108,8 @@ ;; If render throws, React may get confused, and throw on ;; unmount as well, so try to force React to start over. (try - (.' js/React unmountComponentAtNode node) - (catch js/Object e + (.! node :innerHTML "") + (catch :default e (do (warn "Error unmounting:") (log e))))) @@ -122,7 +122,7 @@ (swap! roots assoc container [comp container]) (if (some? callback) (callback)))))) - (catch js/Object e + (catch :default e (do (clear-container container) (throw e)))))