wip: do not fire lifecycle hooks when already unmounted

This commit is contained in:
Evan You
2019-09-11 09:07:29 -04:00
parent 6bc368b2b6
commit 51914c76e8
3 changed files with 9 additions and 0 deletions

View File

@@ -17,6 +17,9 @@ function injectHook(
) {
if (target) {
;(target[type] || (target[type] = [])).push((...args: any[]) => {
if (target.isUnmounted) {
return
}
// disable tracking inside all lifecycle hooks
// since they can potentially be called inside effects.
pauseTracking()