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; }); } },