You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 RefCallback returned from the hook are
in use, then no ResizeObserver instance will get created until there's an
actual element to observe. Resolves: #42
Fixed an error where in certain edge cases the hook tried to set state when
its host component already unmounted.
Features
The ref option now accepts raw elements as well.
BREAKING CHANGES
The returned ref is now a RefCallback, not a ref object. Resolves: #43, #45
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".
Compared to 6.2.0-alpha.1 There's no callbackRef return value anymore.
Misc
Using package.json file attr instead of gitignore (c58f34e)
Handling custom refs (through options), the default ref and the RefCallback
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.