useDimensions
useDimensions copied to clipboard
Use ResizeObserver if supported
This PR allows to listen for box size changes even without browser window resize. So if you have something like resizable grid with your components in it, your components will listen for changing grid items size.
@Swizec what are you think about that? does it looks good to you? maybe you have some suggestions?
This change is pretty necessary. As it currently stands, this hook's returned values won't change if a child element causes it to resize!