Home > @lynx-js/react-rsbuild-plugin > PluginReactLynxOptions > enableCSSInvalidation

PluginReactLynxOptions.enableCSSInvalidation property

CSS Invalidation refers to the process of determining which elements need to have their styles recalculated when the element is updated.

Signature:

enableCSSInvalidation?: boolean;

Remarks

When using combinator to determine the styles of various elements (including descendants, adjacent siblings, etc.), it is recommended to enable this feature. Otherwise, only the initial class setting can match the corresponding combinator, and subsequent updates will not recalculate the related styles.

We find that collecting invalidation nodes and updating them is a relatively time-consuming process. If there is no such usage and better style matching performance is needed, this feature can be selectively disabled.

Example

If a descendant selector .a .b is defined in a CSS file, then when an element's class changes to .a, all nodes in its subtree with the className .b need to have their styles recalculated.

除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。