From bda7795ea8298e00ed57960c256d9c98996c54d1 Mon Sep 17 00:00:00 2001 From: wade Date: Tue, 30 Dec 2025 22:52:55 +0800 Subject: [PATCH 1/2] update test case and version issue --- package.json | 2 +- src/utils/textFormatting.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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..7b8b718 100644 --- a/src/utils/textFormatting.ts +++ b/src/utils/textFormatting.ts @@ -22,7 +22,7 @@ export function extractTextAndStyles(nodes: React.ReactNode): { } if (React.isValidElement(node)) { - const children = node.props.children; + const children = (node as any).props.children; if (typeof children === "string") { text += `<${styles.length}>${children}`; styles.push({ node, text: children }); From 1e5bc010607b7ec7fc2818aefa8e2348aaca1876 Mon Sep 17 00:00:00 2001 From: wade Date: Tue, 30 Dec 2025 22:55:20 +0800 Subject: [PATCH 2/2] update lint --- src/utils/textFormatting.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/textFormatting.ts b/src/utils/textFormatting.ts index 7b8b718..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 as any).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); } } };