From d32bfd886162b780fb2a0970104e3aeffc748267 Mon Sep 17 00:00:00 2001 From: zhouxinyong Date: Mon, 4 Nov 2024 15:41:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Deffect=20style?= =?UTF-8?q?=E6=97=A0=5F=5Fcssinjs=5Finstance=5F=5F=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useStyleRegister.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hooks/useStyleRegister.tsx b/src/hooks/useStyleRegister.tsx index b859850..6236ca7 100644 --- a/src/hooks/useStyleRegister.tsx +++ b/src/hooks/useStyleRegister.tsx @@ -494,11 +494,13 @@ export default function useStyleRegister( // ================= Inject Layer Style ================= // Inject layer style effectLayerKeys.forEach((effectKey) => { - updateCSS( + const effectLayerStyle = updateCSS( normalizeStyle(effectStyle[effectKey]), `_layer-${effectKey}`, { ...mergedCSSConfig, prepend: true }, ); + // fix effect style no CSS_IN_JS_INSTANCE + (effectLayerStyle as any)[CSS_IN_JS_INSTANCE] = cache.instanceId; }); // ==================== Inject Style ==================== @@ -518,11 +520,13 @@ export default function useStyleRegister( // ================ Inject Effect Style ================= // Inject client side effect style effectRestKeys.forEach((effectKey) => { - updateCSS( + const effectRestStyle = updateCSS( normalizeStyle(effectStyle[effectKey]), `_effect-${effectKey}`, mergedCSSConfig, ); + // fix effect style no CSS_IN_JS_INSTANCE + (effectRestStyle as any)[CSS_IN_JS_INSTANCE] = cache.instanceId; }); } },