Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/utils/textFormatting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, unknown>).children;
if (typeof children === "string") {
text += `<${styles.length}>${children}</${styles.length}>`;
styles.push({ node, text: children });
} else if (Array.isArray(children)) {
children.forEach(processNode);
} else if (children) {
processNode(children);
processNode(children as React.ReactNode);
}
}
};
Expand Down