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
I'm not sure why but Resize observer is not triggering at all. I tried using useSize hook implemented from this lib but this also is not working. Can you pls help me somebody ? What can cause this issue ? When I use target.current in dependency array of useLayoutEffect the initial width and height get set but consecutive resizing doesn't trigger anything.
The text was updated successfully, but these errors were encountered:
Very straightforward: your img element enters and leaves the DOM and the hook doesn't use ref.current as a dependency, just ref. You need to set the ref via useState instead of useRef in this case, as shown in the example here: https://codesandbox.io/s/react-hookresize-observer-example-ft88x
I'm not sure why but Resize observer is not triggering at all. I tried using useSize hook implemented from this lib but this also is not working. Can you pls help me somebody ? What can cause this issue ? When I use target.current in dependency array of useLayoutEffect the initial width and height get set but consecutive resizing doesn't trigger anything.
The text was updated successfully, but these errors were encountered: