ZeeCoder / use-resize-observer

A React hook that allows you to use a ResizeObserver to measure an element's size.
MIT License
651 stars 42 forks source link

Merge ref and callbackRef #47

Closed ZeeCoder closed 4 years ago

ZeeCoder commented 4 years ago

There's no good reason I can think of why the returned ref couldn't have been a callback ref.

That way the API gets simplified and usage is easier as users don't have to worry about whether their component will mount with a delay or not.

ZeeCoder commented 4 years ago

Actually, I can release this in the next minor, as I've only released callbackRef as an alpha release

ZeeCoder commented 4 years ago

On second thought I can't change the public API without a major version bump

ZeeCoder commented 4 years ago

Done in v7 alpha