Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复effect style无__cssinjs_instance__的问题 #202

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading