From d2c6e421acdbf1063dfea018a6f49fb3b272073d Mon Sep 17 00:00:00 2001 From: mengxiaoxuan Date: Wed, 28 Feb 2024 11:38:50 +0800 Subject: [PATCH] fix: ssrInline redundance style --- src/hooks/useStyleRegister.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hooks/useStyleRegister.tsx b/src/hooks/useStyleRegister.tsx index d2474a9..7248379 100644 --- a/src/hooks/useStyleRegister.tsx +++ b/src/hooks/useStyleRegister.tsx @@ -493,8 +493,9 @@ export default function useStyleRegister( return (node: React.ReactElement) => { let styleNode: React.ReactElement; + const [times] = cache.get(['style', ...fullPath]) || [0]; - if (!ssrInline || isMergedClientSide || !defaultCache) { + if (!ssrInline || isMergedClientSide || !defaultCache || (ssrInline && !isMergedClientSide && !defaultCache && times > 1)) { styleNode = ; } else { styleNode = (