ant-design / cssinjs

https://ant-design.github.io/cssinjs
MIT License
236 stars 59 forks source link

Missing effect style while mount/unmount due to globalEffectStyleKeys #60

Open noru opened 1 year ago

noru commented 1 year ago

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