From 2e2302fea59dc836e2f9cb80303c73ecbac3708e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=99=8D=EA=B7=9C=EC=A7=84?= Date: Sat, 24 Jan 2026 13:06:31 +0900 Subject: [PATCH 1/2] fix(react-router): prevent hydration warning for async/defer scripts Strip async, defer, and src attributes from script tags during client-side hydration to match the server-rendered output and prevent React hydration mismatch warnings. --- packages/react-router/src/Asset.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-router/src/Asset.tsx b/packages/react-router/src/Asset.tsx index ce1a9699e47..835393fc5d0 100644 --- a/packages/react-router/src/Asset.tsx +++ b/packages/react-router/src/Asset.tsx @@ -144,7 +144,7 @@ function Script({ }, [attrs, children]) if (!router.isServer) { - const { src, ...rest } = attrs || {} + const { src: _src, async: _async, defer: _defer, ...rest } = attrs || {} // render an empty script on the client just to avoid hydration errors return (