Skip to content

Commit 3b077ac

Browse files
committed
fix: no warning
1 parent 53640ae commit 3b077ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hooks/useWinClick.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ export default function useWinClick(
5353
}
5454

5555
// Warning if target and popup not in same root
56-
if (process.env.NODE_ENV !== 'production') {
57-
const targetRoot = targetEle?.getRootNode?.();
56+
if (process.env.NODE_ENV !== 'production' && targetEle) {
57+
const targetRoot = targetEle.getRootNode?.();
5858
const popupRoot = popupEle.getRootNode?.();
5959

6060
warning(

0 commit comments

Comments
 (0)