Skip to content

Commit

Permalink
fixup! fix: removeCSS not work with container
Browse files Browse the repository at this point in the history
  • Loading branch information
Wxh16144 committed Feb 7, 2025
1 parent 0b64c3d commit f9eff0d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/hooks/useStyleRegister.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ export const parseStyle = (
if (!root) {
styleStr = `{${styleStr}}`;
} else if (layer) {

// fixme: https://github.com/thysultan/stylis/pull/339
if (styleStr) {
styleStr = `@layer ${layer.name} {${styleStr}}`;
Expand Down Expand Up @@ -462,7 +461,7 @@ export default function useStyleRegister(
// Remove cache if no need
([, , styleId], fromHMR) => {
if ((fromHMR || autoClear) && isClientSide) {
removeCSS(styleId, { mark: ATTR_MARK });
removeCSS(styleId, { mark: ATTR_MARK, attachTo: container });
}
},

Expand Down

0 comments on commit f9eff0d

Please sign in to comment.