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
A question about the constructor: I think the code creates a new constructor every time a new ref is given. Please correct me if I'm wrong, but given the fact that we always use the same handleResize callback, shouldn't we use a single global ResizeObserver reference?
The text was updated successfully, but these errors were encountered:
I think you mean a new instance of ResizeObserver, not a new constructor - this isn't calling disconnect() on the global ResizeObserver constructor, but rather a local resizeObserver instance. With that in mind I think the code is fine as is, because it's only disconnecting for that particular resize observer instance, not globally across all registered resize observers.
But I'm not expert in ResizeObserver so idk, but if that's the case this can be closed
Thanks for the hook implementation.
A concern about disconnect method: MDN docs say that the
disconnect
method doesn't receive any parameters, it rather disconnects all the connected observers.A question about the constructor: I think the code creates a new constructor every time a new ref is given. Please correct me if I'm wrong, but given the fact that we always use the same
handleResize
callback, shouldn't we use a single global ResizeObserver reference?The text was updated successfully, but these errors were encountered: