Skip to content

Commit 254c9cf

Browse files
Copilotmorganney
andcommitted
Fix TypeScript compilation error in text extraction
Co-authored-by: morganney <848178+morganney@users.noreply.github.com>
1 parent c4ac279 commit 254c9cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/tts-react/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const extractTextFromChildren = (children: ReactNode): string => {
3535
}
3636

3737
// Handle React elements
38-
if (isValidElement(children) && children.props && 'children' in children.props) {
38+
if (isValidElement(children) && children.props && typeof children.props === 'object' && children.props !== null && 'children' in children.props) {
3939
// For React elements, recursively extract text from their children
4040
return extractTextFromChildren(children.props.children as ReactNode)
4141
}

0 commit comments

Comments
 (0)