Skip to content

v6.0.0

Latest

Choose a tag to compare

@dazlious dazlious released this 05 Jun 15:18
e3ae10f

Breaking Changes

  • Webpack 5 is required. css-loader must be configured with esModule: false (the loader reads CSS module class names from exports.locals).
  • Static properties are no longer hoisted by withStyles (e.g. fetchData). Access them via the ComposedComponent property on the wrapper instead.
  • prop-types validation 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 package exports map. All previously available subpaths keep working with exports-aware tooling (webpack 5, modern Node, Jest ≥28).

Fixes

  • React 18/19 compatibility: withStyles now 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)
  • useStyles re-runs style insertion when insertCss changes, 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 type attribute 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.