Skip to content

Releases: bloczjs/react-responsive

v5.1.0

06 Jun 09:14

Choose a tag to compare

What's Changed

Deprecations, will be removed in the next major

  • MediaRangesProvider and MediaRangesContext — use createMediaRanges instead (#187)
  • The as prop on the top-level Only (#187) — wrap children in the element you need, or use createMediaRanges's Only
  • The "breakpoint"-named aliases kept for backward compatibility after the rename (#181):
    • exports: useBreakpoint, BreakpointsProvider, BreakpointsContext
    • props on BreakpointsProvider: breakpoints, additionalBreakpoints

Customer facing

  • Add createMediaRanges + DEFAULT_MEDIA_RANGES, a strongly-typed alternative to MediaRangesProvider (#187)
    • createMediaRanges(ranges) returns a { useMediaRange, Only } pair bound to the ranges you pass in — no React context, no additionalMediaRanges vs mediaRanges split
    • The returned useMediaRange / Only validate the on string end-to-end: every space-separated token must match a declared range or its auto-generated Up / Down alias. Invalid input surfaces a readable TypeScript error like Invalid media ranges: foo bar instead of never
    • The returned Only only forwards childrenas and arbitrary forwarded props are not supported; wrap your children in whatever element you need
    • Spread DEFAULT_MEDIA_RANGES when you want to keep the defaults (xs, sm, md, lg, xl)
  • Rename "breakpoint" to "media range" across the library, tests and documentation to better reflect that each name describes a range between two breakpoints rather than a single breakpoint (#181)
    • New exports: useMediaRange, MediaRangesProvider, MediaRangesContext
    • New props on MediaRangesProvider: mediaRanges, additionalMediaRanges
    • Previous exports are kept but deprecated

Internal

  • Migrate from yarn to pnpm (#200)
  • Replace eslint & prettier by oxlint & oxfmt (#197)
  • Replace jest & jest-dom & puppeteer & parcel with vite + vitest + playwright (#201 & #203)
  • Update README.md (#207)

Full Changelog: v5.0.0...v5.1.0

v5.1.0-alpha.0

31 May 12:17

Choose a tag to compare

v5.1.0-alpha.0 Pre-release
Pre-release

What's Changed

Deprecations, will be removed in the next major

  • MediaRangesProvider and MediaRangesContext — use createMediaRanges instead (#187)
  • The as prop on the top-level Only (#187) — wrap children in the element you need, or use createMediaRanges's Only
  • The "breakpoint"-named aliases kept for backward compatibility after the rename (#181):
    • exports: useBreakpoint, BreakpointsProvider, BreakpointsContext
    • props on BreakpointsProvider: breakpoints, additionalBreakpoints

Customer facing

  • Add createMediaRanges + DEFAULT_MEDIA_RANGES, a strongly-typed alternative to MediaRangesProvider (#187)
    • createMediaRanges(ranges) returns a { useMediaRange, Only } pair bound to the ranges you pass in — no React context, no additionalMediaRanges vs mediaRanges split
    • The returned useMediaRange / Only validate the on string end-to-end: every space-separated token must match a declared range or its auto-generated Up / Down alias. Invalid input surfaces a readable TypeScript error like Invalid media ranges: foo bar instead of never
    • The returned Only only forwards childrenas and arbitrary forwarded props are not supported; wrap your children in whatever element you need
    • Spread DEFAULT_MEDIA_RANGES when you want to keep the defaults (xs, sm, md, lg, xl)
  • Rename "breakpoint" to "media range" across the library, tests and documentation to better reflect that each name describes a range between two breakpoints rather than a single breakpoint (#181)
    • New exports: useMediaRange, MediaRangesProvider, MediaRangesContext
    • New props on MediaRangesProvider: mediaRanges, additionalMediaRanges
    • Previous exports are kept but deprecated

Internal

  • Migrate from yarn to pnpm (#200)
  • Replace eslint & prettier by oxlint & oxfmt (#197)
  • Replace jest & jest-dom & puppeteer & parcel with vite + vitest + playwright (#201 & #203)

Full Changelog: v5.0.0...v5.1.0-alpha.0

v5.0.0

20 May 11:30

Choose a tag to compare

What's Changed

  • Switch useMediaQuery to useSyncExternalStore to fix crashes in React 19 caused by re-renders on mount when there are many components [customer-facing] (#171, tests in #172)
    If you are on React 16.8+ / React 17, you'll need to use use-sync-external-store to polyfill useSyncExternalStore added in React 18 (so breaking change).
    • Add getServerSnapshot to fix crashes on Node (#174)
  • Migrate build system from microbundle to tsdown [internal, may impact devs] (#144)
  • Update TypeScript config [internal]
    • Change TypeScript target from ES5 to ESNext (#135)
    • Change moduleResolution from node to bundler (#134)
    • Add rootDir to tsconfig.json (#133)
  • Other internal dev / tests changes [internal]
    • Update mock-match-media to v1 (#95)
    • Bump typescript from 5.7.2 to 5.9.3 (#120)
    • Bump eslint from 10.2.1 to 10.4.0 (#145, #167)
    • Bump @eslint-react/eslint-plugin from 1.18.0 to 5.7.10 (#119, #146, #154, #170)
    • Bump @typescript-eslint/parser from 8.18.0 to 8.58.0 and typescript-eslint group bumps (#117, #131, #150, #153, #166, #149)
    • Bump jest-environment-jsdom from 29.7.0 to 30.4.1 + manual Jest update (#125, #156, #164)
    • Bump ts-jest from 29.2.5 to 29.4.6 (#116)
    • Bump jest-puppeteer from 10.1.4 to 11.0.0 (#118)
    • Bump puppeteer from 24.42.0 to 25.0.2 (#160, #169)
    • Bump @testing-library/dom from 10.4.0 to 10.4.1 (#128)
    • Bump parcel from 2.13.2 to 2.16.4 (#130)
    • Bump tsdown from 0.21.10 to 0.22.0 (#161)
    • Bump @types/node from 25.6.0 to 25.8.0 (#157, #168)
    • Bump ws from 8.20.0 to 8.20.1 (#173)
    • Bump actions/setup-node from 3 to 6, actions/checkout from 3 to 6 (#114, #115)
    • Add Node.js 24.x and 25.x and 26.x to the CI matrix (#113, #163, (#165))
    • Add Dependabot configuration (npm, GitHub Actions, React and typescript-eslint groups) (#112, #149, #158)

Full Changelog: v4.0.0...v5.0.0

v4.0.2 – unpublished

20 May 10:59

Choose a tag to compare

What's Changed

  • Bugfix: [useMediaQuery] add getServerSnapshot – fix SSR by @Ayc0 in #174
  • internal changes:
    • Bump ws from 8.20.0 to 8.20.1 by @dependabot[bot] in #173
    • Add Node.js version 26.x to workflow matrix by @Ayc0 in #165

Full Changelog: v4.0.1...v4.0.2

v4.0.1 – unpublished

19 May 09:12
v4.0.1
dff51ea

Choose a tag to compare

What's Changed

  • Switch useMediaQuery to useSyncExternalStore to fix crashes in React 19 caused by re-renders on mount when there are many components [customer-facing] (#171, tests in #172)
    If you are on React 16.8+ / React 17, you'll need to use use-sync-external-store to polyfill useSyncExternalStore added in React 18
  • Migrate build system from microbundle to tsdown [internal, may impact devs] (#144)
  • Update TypeScript config [internal]
    • Change TypeScript target from ES5 to ESNext (#135)
    • Change moduleResolution from node to bundler (#134)
    • Add rootDir to tsconfig.json (#133)
  • Other internal dev / tests changes [internal]
    • Update mock-match-media to v1 (#95)
    • Bump typescript from 5.7.2 to 5.9.3 (#120)
    • Bump eslint from 10.2.1 to 10.4.0 (#145, #167)
    • Bump @eslint-react/eslint-plugin from 1.18.0 to 5.7.10 (#119, #146, #154, #170)
    • Bump @typescript-eslint/parser from 8.18.0 to 8.58.0 and typescript-eslint group bumps (#117, #131, #150, #153, #166, #149)
    • Bump jest-environment-jsdom from 29.7.0 to 30.4.1 + manual Jest update (#125, #156, #164)
    • Bump ts-jest from 29.2.5 to 29.4.6 (#116)
    • Bump jest-puppeteer from 10.1.4 to 11.0.0 (#118)
    • Bump puppeteer from 24.42.0 to 25.0.2 (#160, #169)
    • Bump @testing-library/dom from 10.4.0 to 10.4.1 (#128)
    • Bump parcel from 2.13.2 to 2.16.4 (#130)
    • Bump tsdown from 0.21.10 to 0.22.0 (#161)
    • Bump @types/node from 25.6.0 to 25.8.0 (#157, #168)
    • Bump actions/setup-node from 3 to 6, actions/checkout from 3 to 6 (#114, #115)
    • Add Node.js 24.x and 25.x to the CI matrix (#113, #163)
    • Add Dependabot configuration (npm, GitHub Actions, React and typescript-eslint groups) (#112, #149, #158)

Full Changelog: v4.0.0...v4.0.1

v4.0.0

01 Jan 21:08

Choose a tag to compare

What's Changed

See https://ayc0.github.io/posts/others/blocz-react-responsive-v4 for the blog post.

  • Remove <Match> by @Ayc0 in #67 BREAKING CHANGE
  • Drop toJSON & toCSS by @Ayc0 in #84 BREAKING CHANGE
  • update react to v19 by @Ayc0 in #83

Other small updates

Full Changelog: v3.0.3...v4.0.0-beta.0

v4.0.0-beta.1

09 Dec 23:08

Choose a tag to compare

v4.0.0-beta.1 Pre-release
Pre-release

What's Changed

  • Drop toJSON & toCSS by @Ayc0 in #84 BREAKING CHANGE
  • use @eslint-react/eslint-plugin instead of eslint-plugin-react by @Ayc0 in #85
  • Update ESLint to v9 & flat config by @Ayc0 in #86
  • Enable isolatedDeclarations by @Ayc0 in #87

Full Changelog: v4.0.0-beta.0...v4.0.0-beta.1

v4.0.0-beta.0

09 Dec 19:44

Choose a tag to compare

v4.0.0-beta.0 Pre-release
Pre-release

What's Changed

Other small updates

Full Changelog: v3.0.3...v4.0.0-beta.0

v3.0.3

20 Mar 14:15

Choose a tag to compare

What's Changed

Exposed changes:

  • Add types in exports by @Ayc0 in #60
  • [react 18] mark as available by @Ayc0 in #44
  • [react][types] update to v18 by @Ayc0 in #49

Internal changes:

Full Changelog: v3.0.2...v3.0.3

v3.0.2

22 Apr 21:13

Choose a tag to compare

  • Better fix only and matchMedia props on DOM elements for the Match component
    • With the implementation of the v3.0.0, we were polluting the global scope, injecting the variable React everywhere. This version ships a better fix for both of them.
  • Add support for node 15 and 16