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 change in a ref will not case a re-render, so there's no guarantee that this effect will be called. I'd suggest refactoring it to accept an empty array - it'll work the same.
The text was updated successfully, but these errors were encountered:
I agree - I've confirmed in my project it doesn't work properly, because if the ref changes it won't trigger useEffect to refresh. You're supposed to use useCallback to make a callback ref like the React docs recommend.
Currently trying to figure out how I can use that approach with this library, though the TypeScript typings assert that it needs a RefObject as the parameter, which this callback approach does not produce - I'm thinking I need to make a fake RefObject that actually is just the DOM element I retrieve and store in state from the useCallback() ref, so that the library can use it
I don't believe this code will work as expected:
component-size/index.js
Line 56 in c0abcb9
A change in a ref will not case a re-render, so there's no guarantee that this effect will be called. I'd suggest refactoring it to accept an empty array - it'll work the same.
The text was updated successfully, but these errors were encountered: