Skip to content

Commit ee409ea

Browse files
authored
change destroy to safelyCallDestroy (#19605)
We use safelyCallDestroy for commitUnmount and passive effects unmounts but we call destroy directly in commitHookEffectListUnmount (AKA layout effects unmounts because we don't use this anywhere else). This PR changes the direct destroy call to safelyCallDestroy for consistency
1 parent bcca5a6 commit ee409ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-reconciler/src/ReactFiberCommitWork.new.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ function commitHookEffectListUnmount(tag: HookEffectTag, finishedWork: Fiber) {
335335
constdestroy=effect.destroy;
336336
effect.destroy=undefined;
337337
if(destroy!==undefined){
338-
destroy();
338+
safelyCallDestroy(finishedWork,destroy);
339339
}
340340
}
341341
effect=effect.next;

0 commit comments

Comments
 (0)
close