Skip to content

Commit 99a7d81

Browse files
authored
fix: add an if statement before calling the unmountComponentAtNode (#319)
1 parent 97fa8ca commit 99a7d81

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/contextView/index.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ export function useContextView(props: IContextViewProps = {}): IContextView {
6868
const hide = () => {
6969
if (contextView) {
7070
contextView.style.visibility = 'hidden';
71-
ReactDOM.unmountComponentAtNode(select('.' + contentClassName)!);
71+
const contentContainer = select('.' + contentClassName);
72+
if (contentContainer) {
73+
ReactDOM.unmountComponentAtNode(contentContainer);
74+
}
7275
Emitter.emit(ContextViewEvent.onHide);
7376
}
7477
};

0 commit comments

Comments
 (0)