Skip to content

Commit

Permalink
fix: 修复effect style无__cssinjs_instance__的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouxinyong committed Nov 4, 2024
1 parent eabc24e commit d32bfd8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/hooks/useStyleRegister.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ====================
Expand All @@ -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;
});
}
},
Expand Down

0 comments on commit d32bfd8

Please # to comment.