Skip to content

Releases: ZeeCoder/use-resize-observer

7.0.0-alpha.1

02 Nov 07:53
Compare
Choose a tag to compare
7.0.0-alpha.1 Pre-release
Pre-release
  • Added tests in real browsers with Browserstack, so that we ensure the lib
    works all the way back to IE11.
  • [BREAKING] The returned ref is now a RefCallback, not a ref object
  • [BREAKING] The returned ref will always be the same RefCallback.
    Previously when a custom ref object was passed, it was returned as well from
    the hook as "ref".
  • [BREAKING] Compared to 6.2.0-alpha.1 There's no callbackRef return value
    anymore.

v6.2.0-alpha.1

11 Oct 12:46
Compare
Choose a tag to compare
v6.2.0-alpha.1 Pre-release
Pre-release
  • Only instantiating a ResizeObserver instance if there's actually something to
    observe. This for example means that if you pass in null or undefined as the
    ref, or if neither the default ref or callback ref returned from the hook are
    in use, then no ResizeObserver instance will get created until there's an
    actual element to observe. Resolves: #42
  • The hook now returns callbackRef, which can be used in place of the usual
    ref. Use this instead of a normal ref, when the observed component is
    mounted with a delay. Resolves: #43, #45
  • The ref option now accepts raw elements as well.
  • Handling custom refs (through options), the default ref and the callback ref
    has been greatly refactored internally (into the useResolvedElement
    hook), to handle more edge cases with the way refs are handled.
  • Tests based on react testing library were refactored to make them much simpler
    and more approachable.
  • Fixed an error where in certain edge cases the hook tried to set state when
    its host component already unmounted.
  • Added contributing guidelines
  • Overall bundle size increased a bit, due to the new features added.
    (With about ~150B or so.)

As this is an alpha release, feedback are welcome.

v6.1.0

24 May 16:16
Compare
Choose a tag to compare

No changes, only publishing the next minor.

v6.1.0-alpha.3

29 Apr 20:57
Compare
Choose a tag to compare
v6.1.0-alpha.3 Pre-release
Pre-release
  • Fixed SSR rendering, and added a test to cover it.

v6.1.0-alpha.2

20 Apr 18:37
Compare
Choose a tag to compare
v6.1.0-alpha.2 Pre-release
Pre-release

ResizeObserver instances are no longer created unnecessarily when the onResize callback changes. (Fixes #32)

v6.1.0-alpha.1

16 Apr 15:15
Compare
Choose a tag to compare
v6.1.0-alpha.1 Pre-release
Pre-release
  • Rewrote the source in TypeScript. (Feedback is welcome.)
  • Rewrote tests in TypeScript as well. (Ensures the types make sense.)
  • Added checks to ensure small bundle size.

v6.0.0

29 Dec 20:05
Compare
Choose a tag to compare
  • [BREAKING] Default width and height can now be set by declaring defaults
    for object destructuring, instead of having custom options for them.
    This means the following options were removed: defaultWidth, defaultHeight,
    useDefaults.
  • [BREAKING] Due to the above, the default width and height will be
    undefined instead of 1.
  • Docs were updated to reflect the above changes.
  • Added an onResize handler that can report size changes instead of the default
    object return. (This also helps implementing a more performant throttle /
    debounce solution.)

v5.0.0

18 Nov 22:42
Compare
Choose a tag to compare
  • [BREAKING] #14 Removed the polyfill from the default builds, and shipping
    it instead as as separate module.
  • [BREAKING] #21 Returning an object instead of an array, so that values not
    needed could be omitted.
  • Improved ref handling:
    • #16 You can now pass in your own ref
    • The same hook instance can now be reused with different refs
    • The hook will no longer break if the ref is not immediately filled.
      (Anything other than an object with a .current value of an Element will
      be ignored.)
  • Made defaults optional with the useDefaults option.
  • #18 Added missing copyright notice in the MIT license.
  • New package.json scripts to ease development
  • Added throttle and debounce guides to the readme
  • More tests

v4.0.0

20 Jul 20:14
Compare
Choose a tag to compare

v3.1.0

11 Feb 12:57
Compare
Choose a tag to compare

Added Typescript types