diff --git a/packages/react-debug-tools/src/__tests__/ReactHooksInspectionIntegration-test.js b/packages/react-debug-tools/src/__tests__/ReactHooksInspectionIntegration-test.js index 87f98b99f2..79ec20c3c2 100644 --- a/packages/react-debug-tools/src/__tests__/ReactHooksInspectionIntegration-test.js +++ b/packages/react-debug-tools/src/__tests__/ReactHooksInspectionIntegration-test.js @@ -1553,7 +1553,7 @@ describe('ReactHooksInspectionIntegration', () => { expect(tree[0].id).toEqual(0); expect(tree[0].isStateEditable).toEqual(false); expect(tree[0].name).toEqual('Id'); - expect(String(tree[0].value).startsWith(':r')).toBe(true); + expect(String(tree[0].value).startsWith('\u00ABr')).toBe(true); expect(normalizeSourceLoc(tree)[1]).toMatchInlineSnapshot(` { diff --git a/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js b/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js index 6a86cbb265..963f516b15 100644 --- a/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js +++ b/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js @@ -858,7 +858,7 @@ export function makeId( ): string { const idPrefix = resumableState.idPrefix; - let id = ':' + idPrefix + 'R' + treeId; + let id = '\u00AB' + idPrefix + 'R' + treeId; // Unless this is the first id at this level, append a number at the end // that represents the position of this useId hook among all the useId @@ -867,7 +867,7 @@ export function makeId( id += 'H' + localId.toString(32); } - return id + ':'; + return id + '\u00BB'; } function encodeHTMLTextNode(text: string): string { diff --git a/packages/react-dom/src/__tests__/ReactDOMUseId-test.js b/packages/react-dom/src/__tests__/ReactDOMUseId-test.js index af5dbdd355..7738994fb1 100644 --- a/packages/react-dom/src/__tests__/ReactDOMUseId-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMUseId-test.js @@ -96,7 +96,7 @@ describe('useId', () => { } function normalizeTreeIdForTesting(id) { - const result = id.match(/:(R|r)([a-z0-9]*)(H([0-9]*))?:/); + const result = id.match(/\u00AB(R|r)([a-z0-9]*)(H([0-9]*))?\u00BB/); if (result === undefined) { throw new Error('Invalid id format'); } @@ -285,7 +285,7 @@ describe('useId', () => { // 'R:' prefix, and the first character after that, which may not correspond // to a complete set of 5 bits. // - // Example: :Rclalalalalalalala...: + // Example: «Rclalalalalalalala...: // // We can use this pattern to test large ids that exceed the bitwise // safe range (32 bits). The algorithm should theoretically support ids @@ -320,8 +320,8 @@ describe('useId', () => { // Confirm that every id matches the expected pattern for (let i = 0; i < divs.length; i++) { - // Example: :Rclalalalalalalala...: - expect(divs[i].id).toMatch(/^:R.(((al)*a?)((la)*l?))*:$/); + // Example: «Rclalalalalalalala...: + expect(divs[i].id).toMatch(/^\u00ABR.(((al)*a?)((la)*l?))*\u00BB$/); } }); @@ -345,7 +345,7 @@ describe('useId', () => {