Teact: Avoid multiple effects in a single frame (follow-up)
This commit is contained in:
parent
6b235729f4
commit
077dce9fc0
@ -461,10 +461,9 @@ export function unmountComponent(componentInstance: ComponentInstance) {
|
||||
effect.cleanup?.();
|
||||
} catch (err: any) {
|
||||
handleError(err);
|
||||
} finally {
|
||||
effect.cleanup = undefined;
|
||||
}
|
||||
|
||||
effect.cleanup = undefined;
|
||||
effect.releaseSignals?.();
|
||||
});
|
||||
|
||||
@ -586,10 +585,6 @@ function useEffectBase(
|
||||
const componentInstance = renderingInstance;
|
||||
|
||||
function execCleanup() {
|
||||
if (!componentInstance.isMounted) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { cleanup } = byCursor[cursor];
|
||||
if (!cleanup) {
|
||||
return;
|
||||
@ -618,9 +613,9 @@ function useEffectBase(
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`[Teact] Error in effect cleanup at cursor #${cursor} in ${componentInstance.name}`);
|
||||
handleError(err);
|
||||
} finally {
|
||||
byCursor[cursor].cleanup = undefined;
|
||||
}
|
||||
|
||||
byCursor[cursor].cleanup = undefined;
|
||||
}
|
||||
|
||||
function exec() {
|
||||
@ -628,8 +623,6 @@ function useEffectBase(
|
||||
return;
|
||||
}
|
||||
|
||||
execCleanup();
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
let DEBUG_startAt: number | undefined;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user