Skip to content

Commit

Permalink
fix: ensure getTextContent returns an empty string for invalid nodes …
Browse files Browse the repository at this point in the history
…in Popup component
  • Loading branch information
aojunhao123 committed Jan 2, 2025
1 parent 3f2bea8 commit dbe400e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit dbe400e

Please sign in to comment.