Skip to content

v3.0.0

Compare
Choose a tag to compare
@Ayc0 Ayc0 released this 12 Mar 13:15
  • The package was renamed @blocz/react-responsive instead of react-only
  • rename useOnly to useBreakpoint and useQuery to useMediaQuery BREAKING CHANGE
    • Those were renamed for 2 reasons:
      1. useOnly isn’t really explicit
      2. useQuery can be confused with react-query’s or apollo’s useQuery hooks
  • useBreakpoint and useMediaQuery stop returning undefined during the initialization and if the media query is invalid. Instead it will directly use the correct value, and if the media query is invalid, it’ll return false. BREAKING CHANGE
  • Bump peerDependencies to allow for react 17
  • Drop support for node 10
  • Remove prop strict BREAKING CHANGE:
    • This feature was initially introduced to avoid collision between mdUp and smDown for instance. But since we avoid the overlapping of breakpoints in the v1.0.1 and as this is customizable, this prop doesn't make sense anymore.
    • This prop relied on calc(% + 1px) and calc(% - 1px) which has 2 issues:
      • difficult to be compatible with SSR as for instance css-mediaquery crashes when we use calc() (see issue),
      • 1px is really arbitrary and not customizable so anyway if someone wanted to change that, they had to use custom breakpoints.
  • Fix only and matchMedia props on DOM elements for the Match component
    • Inject MatchChildProps in HTMLAttributes from the global namespace React