Skip to content

Commit

Permalink
fix a runtime error
Browse files Browse the repository at this point in the history
  • Loading branch information
MrWangJustToDo committed May 8, 2024
1 parent f423611 commit fc2c11e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/react/src/components/DiffView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ const DiffViewWithRef = <T extends unknown>(
}
}, [diffFile, _diffFile]);

useUnmount(() => diffFile._destroy(), [diffFile]);
useUnmount(() => diffFile?._destroy?.(), [diffFile]);

useImperativeHandle(ref, () => ({ getDiffFileInstance: () => diffFile }), [diffFile]);

Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/components/DiffView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export const DiffView = defineComponent<

useProvide(props, "extendData", extendDataSymbol, { deepWatch: true });

onUnmounted(() => diffFile.value._destroy?.());
onUnmounted(() => diffFile.value?._destroy?.());

options.expose({ getDiffFileInstance: () => diffFile.value });

Expand Down

0 comments on commit fc2c11e

Please sign in to comment.