cssinjs icon indicating copy to clipboard operation
cssinjs copied to clipboard

Missing effect style while mount/unmount due to globalEffectStyleKeys

Open noru opened this issue 3 years ago • 0 comments

related: https://github.com/ant-design/ant-design/issues/38911

A web component could be mount/unmount for multiple times. During when the actual dom could be created/recreated many times.

In such case, due to the cache mechanism: useStyleRegister.tsx#L386, some styles(particularly keyframes) are not able to be injected into the newly created dom element.

One way to solve this, is to use _cf, but obviously its not for production


Purpposal:

  1. expose _cf in some way
  2. execute some tear down actions during unmount phase

noru avatar Dec 06 '22 09:12 noru