diff --git a/package.json b/package.json index cf8d7f8..a444b21 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "type": "module", "name": "react-autolocalise", - "version": "1.1.0", + "version": "1.1.3", "description": "Auto-translation SDK for React and Next.js applications with SSR support", "main": "dist/index.cjs", "module": "dist/index.mjs", diff --git a/src/utils/textFormatting.ts b/src/utils/textFormatting.ts index dda76cd..c99534a 100644 --- a/src/utils/textFormatting.ts +++ b/src/utils/textFormatting.ts @@ -22,14 +22,14 @@ export function extractTextAndStyles(nodes: React.ReactNode): { } if (React.isValidElement(node)) { - const children = node.props.children; + const children = (node.props as Record).children; if (typeof children === "string") { text += `<${styles.length}>${children}`; styles.push({ node, text: children }); } else if (Array.isArray(children)) { children.forEach(processNode); } else if (children) { - processNode(children); + processNode(children as React.ReactNode); } } };