Home > @lynx-js/react-rsbuild-plugin > PluginReactLynxOptions > enableCSSInvalidation
CSS Invalidation refers to the process of determining which elements need to have their styles recalculated when the element is updated.
Signature:
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.
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.