We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c4ac279 commit 254c9cfCopy full SHA for 254c9cf
packages/tts-react/src/utils.ts
@@ -35,7 +35,7 @@ const extractTextFromChildren = (children: ReactNode): string => {
35
}
36
37
// Handle React elements
38
- if (isValidElement(children) && children.props && 'children' in children.props) {
+ if (isValidElement(children) && children.props && typeof children.props === 'object' && children.props !== null && 'children' in children.props) {
39
// For React elements, recursively extract text from their children
40
return extractTextFromChildren(children.props.children as ReactNode)
41
0 commit comments