From d678cff2e08c1a05c6f4109a021de32bbe6ddc14 Mon Sep 17 00:00:00 2001 From: Syed Muhammad Ammar Date: Mon, 16 Feb 2026 18:39:37 +0500 Subject: [PATCH 1/3] fix(hydration): key change --- .../react-router/lib/dom/ssr/components.tsx | 185 +++++++++--------- 1 file changed, 93 insertions(+), 92 deletions(-) diff --git a/packages/react-router/lib/dom/ssr/components.tsx b/packages/react-router/lib/dom/ssr/components.tsx index 2e0f101511..c103fe5555 100644 --- a/packages/react-router/lib/dom/ssr/components.tsx +++ b/packages/react-router/lib/dom/ssr/components.tsx @@ -585,13 +585,13 @@ export function Meta(): React.JSX.Element { routeMeta = typeof routeModule.meta === "function" ? (routeModule.meta as MetaFunction)({ - data, - loaderData: data, - params, - location, - matches, - error, - }) + data, + loaderData: data, + params, + location, + matches, + error, + }) : Array.isArray(routeModule.meta) ? [...routeModule.meta] : routeModule.meta; @@ -606,10 +606,10 @@ export function Meta(): React.JSX.Element { if (!Array.isArray(routeMeta)) { throw new Error( "The route at " + - _match.route.path + - " returns an invalid value. All route meta functions must " + - "return an array of meta objects." + - "\n\nTo reference the meta function API, see https://remix.run/route/meta", + _match.route.path + + " returns an invalid value. All route meta functions must " + + "return an array of meta objects." + + "\n\nTo reference the meta function API, see https://remix.run/route/meta", ); } @@ -621,7 +621,7 @@ export function Meta(): React.JSX.Element { return ( <> - {meta.flat().map((metaProps) => { + {meta.flat().map((metaProps, index) => { if (!metaProps) { return null; } @@ -656,10 +656,13 @@ export function Meta(): React.JSX.Element { if ("script:ld+json" in metaProps) { try { let json = JSON.stringify(metaProps["script:ld+json"]); + let ldJsonKey = `script:ld+json:${index}`; + return (