UNPKG

@w11r/use-breakpoint

Version:

React useBreakpoint hook to have different values for a variable based on a breakpoints.

164 lines (77 loc) 7.27 kB
# Changelog All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. ## [2.0.0](https://github.com/wintercounter/use-breakpoint/compare/v1.7.1...v2.0.0) (2021-04-21) ### ⚠ BREAKING CHANGES * **context:** Add provider to your React tree ```js import { BreakpointProvider } from '@w11r/use-breakpoint' ``` ### Features * **context:** move resize logic into context provider ([74e3531](https://github.com/wintercounter/use-breakpoint/commit/74e3531ca152e63d1af0632d769d3bd2c8e5f796)) * **mediaQuery:** add support for prefix only breakpoints ([436e6e7](https://github.com/wintercounter/use-breakpoint/commit/436e6e7cd50b5a8575170e3209e98a4751af4541)) * **mediaQuery:** add support for shorthands ([2a58497](https://github.com/wintercounter/use-breakpoint/commit/2a58497dd64130a4eb81f86a6cce8dcc2fe7f7a4)) ## [1.8.0](https://github.com/wintercounter/use-breakpoint/compare/v1.7.1...v1.8.0) (2021-01-02) ### Features * **mediaQuery:** add support for prefix only breakpoints ([436e6e7](https://github.com/wintercounter/use-breakpoint/commit/436e6e7cd50b5a8575170e3209e98a4751af4541)) * **mediaQuery:** add support for shorthands ([2a58497](https://github.com/wintercounter/use-breakpoint/commit/2a58497dd64130a4eb81f86a6cce8dcc2fe7f7a4)) ### [1.7.1](https://github.com/wintercounter/use-breakpoint/compare/v1.7.0...v1.7.1) (2020-12-02) ### Bug Fixes * **useBreakpoints:** adding extra check on window so nextjs won't complain ([e35efdb](https://github.com/wintercounter/use-breakpoint/commit/e35efdbcdf76878445a92934327c21e36fc1c187)) * **useBreakpoints:** NextJS support ([9150685](https://github.com/wintercounter/use-breakpoint/commit/915068574328c50bf77aec9c0746021f98fac3d6)) ## [1.7.0](https://github.com/wintercounter/use-breakpoint/compare/v1.6.0...v1.7.0) (2020-07-01) ### Features * add support for media expressions directly from propless useBreakpoint ([b188a49](https://github.com/wintercounter/use-breakpoint/commit/b188a49f65e3f15a03e8ccabd57f5d9f1988ad87)) ### Bug Fixes * use correct cache key ([84e4a5c](https://github.com/wintercounter/use-breakpoint/commit/84e4a5c41765f2a22b80e1a98381a97c79e59678)) ## [1.6.0](https://github.com/wintercounter/use-breakpoint/compare/v1.5.0...v1.6.0) (2020-06-21) ### Features * add multi-range breakpoints ([29c2b9f](https://github.com/wintercounter/use-breakpoint/commit/29c2b9f03899c756c7a6103bb28703112a300e36)) ## [1.5.0](https://github.com/wintercounter/use-breakpoint/compare/v1.4.3...v1.5.0) (2020-06-06) ### Features * add cjs version ([15e436c](https://github.com/wintercounter/use-breakpoint/commit/15e436c543958cb339980ea257462c31452beb91)) ### [1.4.3](https://github.com/wintercounter/use-breakpoint/compare/v1.4.2...v1.4.3) (2020-05-15) ### Bug Fixes * missing dependencies ([cbf6f3a](https://github.com/wintercounter/use-breakpoint/commit/cbf6f3a63487b134218f8a374d1d982c7a8d08f0)) ### [1.4.2](https://github.com/wintercounter/use-breakpoint/compare/v1.4.1...v1.4.2) (2020-05-15) ### Bug Fixes * stop relying on orientation ([8e5b24a](https://github.com/wintercounter/use-breakpoint/commit/8e5b24a61f90f5a91f7976bbbac33045454bd853)) ### [1.4.1](https://github.com/wintercounter/use-breakpoint/compare/v1.4.0...v1.4.1) (2020-03-25) ### Bug Fixes * **useBreakpoint:** match logic to Media Queries logic ([b7b3d56](https://github.com/wintercounter/use-breakpoint/commit/b7b3d56ae55859d97005d34a08d70075852789cd)) * useBreakpoint input types ([813c8e9](https://github.com/wintercounter/use-breakpoint/commit/813c8e9cb57ab7f13b69b2c4f41552cc02e30be4)) ## [1.4.0](https://github.com/wintercounter/use-breakpoint/compare/v1.3.3...v1.4.0) (2020-03-05) ### Features * **mediaQuery:** add support for Object type output ([4025772](https://github.com/wintercounter/use-breakpoint/commit/402577293a8818033cd3e8583892da03498e1bf8)) * **options:** add support for short names ([0a4d398](https://github.com/wintercounter/use-breakpoint/commit/0a4d3984f4cf7eb435b69e29dd345b27661b7e44)) ### [1.3.3](https://github.com/wintercounter/use-breakpoint/compare/v1.3.2...v1.3.3) (2020-02-29) ### Bug Fixes * **ssr:** temp solution to allow ssr till v2 ([4e1e5a9](https://github.com/wintercounter/use-breakpoint/commit/4e1e5a9b612f38bf1a5410cf30c23b2401aae275)) ### [1.3.2](https://github.com/wintercounter/use-breakpoint/compare/v1.2.1...v1.3.2) (2020-02-29) ### Bug Fixes * **default:** handle orientation correctly ([b1f2ff4](https://github.com/wintercounter/use-breakpoint/commit/b1f2ff4c1fe7a4e98fce75d3ca406529c59fa53f)) * **ssr:** temp solution to allow ssr till v2 ([4c62d7c](https://github.com/wintercounter/use-breakpoint/commit/4c62d7cf3f638c1de84c989d8561216176d940ec)) ### [1.3.1](https://github.com/wintercounter/use-breakpoint/compare/v1.2.1...v1.3.1) (2020-02-07) ### Bug Fixes * **mediaQuery:** emit all size declarations not only the first one ([ac7ecfd](https://github.com/wintercounter/use-breakpoint/commit/ac7ecfdc27336bb3738c0fcc967efb76b798ddd6)) ## [1.3.0](https://github.com/wintercounter/use-breakpoint/compare/v1.2.0...v1.3.0) (2020-01-16) ### Features * add support for generating Media Query strings ([b4cac9f](https://github.com/wintercounter/use-breakpoint/commit/b4cac9fea59f7e83e17683b839229ee9dfbe164e)) ### Bug Fixes * TS declaration for the case when no values are provided ([ad23da4](https://github.com/wintercounter/use-breakpoint/commit/ad23da4d7e8c5acf8672661e0ba50aae497fc260)) * **default:** handle orientation correctly ([b1f2ff4](https://github.com/wintercounter/use-breakpoint/commit/b1f2ff4c1fe7a4e98fce75d3ca406529c59fa53f)) ## [1.2.0](https://github.com/wintercounter/use-breakpoint/compare/v1.1.1...v1.2.0) (2020-01-06) ### Features * add support for generating Media Query strings ([b4cac9f](https://github.com/wintercounter/use-breakpoint/commit/b4cac9fea59f7e83e17683b839229ee9dfbe164e)) ### Bug Fixes * TS declaration for the case when no values are provided ([ad23da4](https://github.com/wintercounter/use-breakpoint/commit/ad23da4d7e8c5acf8672661e0ba50aae497fc260)) ### [1.1.1](https://github.com/wintercounter/use-breakpoint/compare/v1.1.0...v1.1.1) (2019-12-10) ### Bug Fixes * cache `window.innerWidth` for better performance ([c849134](https://github.com/wintercounter/use-breakpoint/commit/c8491348c08d07ac5cd1139788546d4e664a2ce7)) ## [1.1.0](https://github.com/wintercounter/use-breakpoint/compare/v1.0.1...v1.1.0) (2019-11-07) ### Features * add support for meaningful default value when no arguments provided for the hook ([38352f5](https://github.com/wintercounter/use-breakpoint/commit/38352f5)) ### [1.0.1](https://github.com/wintercounter/use-breakpoint/compare/v1.0.0...v1.0.1) (2019-08-22) ### Bug Fixes * default value change should trigger update ([66a65d7](https://github.com/wintercounter/use-breakpoint/commit/66a65d7)) # Changelog All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.