mirror of https://github.com/status-im/reagent.git
Don't try to unmount on error
React gets very confused when there are errors...
This commit is contained in:
parent
e53a5c2b13
commit
ea021d3b87
|
@ -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)))))
|
||||
|
||||
|
|
Loading…
Reference in New Issue