React Cool Dimensions Versions Save

😎 📏 React hook to measure an element's size and handle responsive components.

v3.0.1

1 year ago

Fix the type of the width and height states #775

v3.0.0

1 year ago

💥 BREAKING CHANGE

  • Initial width and height now are null, see doc. Thanks to @sirkrisp

v2.0.7

2 years ago
  • fix: eliminate the error of loop limit exceeded, thanks to @cornelius-behrend (#501)

v2.0.6

2 years ago
  • Refactor(types): enhance the types of event properties (#477)

v2.0.5

2 years ago
  • Refactor(types): export more types to fulfill your use cases ( #474 )

v2.0.4

3 years ago
  • Refactor(types): simplify generic variable
-  const { observe } = useDimensions<HTMLDivElement | null>();
+  const { observe } = useDimensions<HTMLDivElement>();

v2.0.3

3 years ago
  • Fix: avoid extra re-rendering

v2.0.2

3 years ago
  • Refactor: eliminate the loop exceeded warning, thanks to @rfgamaral (#435) (#373)

v2.0.1

3 years ago

Fix: un-observe the previous target element when updating the new target element via the observe API

v2.0.0

3 years ago

✌🏻 React Cool Dimensions V2 comes out!

  • Remove ref API, use observe instead, see this example
  • Remove ref option, if you want to share a ref see this example
  • Smaller bundle size, around 1kB gzipped
  • Fix the type of exported hook function