Don't try to unmount on error

React gets very confused when there are errors...
This commit is contained in:
Dan Holmsand 2015-08-30 21:53:23 +02:00
parent e53a5c2b13
commit ea021d3b87
1 changed files with 3 additions and 3 deletions

View File

@ -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)))))