Breaking Changes
- Webpack 5 is required.
css-loadermust be configured withesModule: false(the loader reads CSS module class names fromexports.locals). - Static properties are no longer hoisted by
withStyles(e.g.fetchData). Access them via theComposedComponentproperty on the wrapper instead. prop-typesvalidation has been removed.- Package layout changed: compiled files now live under
dist/and deep imports (isomorphic-style-loader/insertCss,isomorphic-style-loader/withStyles, …) resolve through the packageexportsmap. All previously available subpaths keep working withexports-aware tooling (webpack 5, modern Node, Jest ≥28).
Fixes
- React 18/19 compatibility:
withStylesnow inserts styles in the commit phase instead of the constructor, fixing leaks when render is interrupted or replayed under concurrent rendering (#218) - Hardened style reference counting in
insertCss, preventing premature style removal and stale<style>tags (#218) useStylesre-runs style insertion wheninsertCsschanges, and inserts styles before paint with corrected browser detection (#218, #215)- CSS modules compatibility fix (#208)
- Style tag ids no longer include an index, keeping ids stable (#216)
Features
- React 19 supported (peer dependency now
^16.8.0 || ^17 || ^18 || ^19) (#217) - New
typeattribute option for generated style tags (#163)
The optional getCss loader option is serialized into the generated module, so it must be a self-contained function without closed-over variables.