From dbe400e30eb67ee0b52682146b8482cf5101576c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=B1=AA?= <1844749591@qq.com> Date: Thu, 2 Jan 2025 16:48:28 +0800 Subject: [PATCH] fix: ensure getTextContent returns an empty string for invalid nodes in Popup component --- src/Popup.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Popup.tsx b/src/Popup.tsx index d949339..7447d85 100644 --- a/src/Popup.tsx +++ b/src/Popup.tsx @@ -29,6 +29,8 @@ const getTextContent = (node: (() => React.ReactNode) | React.ReactNode): string if (React.isValidElement(resolvedNode)) { return getTextContent(resolvedNode.props.children); } + + return ''; }; export default function Popup(props: ContentProps) {