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
The fetchURL function sets the loading and result states in an asynchronous callback. If the component has been unmounted in the meantime, this results to a memory leak.
Reproduction
Just put the ReactTinyLink component in a modal, close the modal before the fetch is done "et voilà" 🚰
Possible fix
You could use a cleanup function in your useEffectAsync which cancels the fetch and sets a variable which prevents the fetchURL to set the state.
The text was updated successfully, but these errors were encountered:
Hi 👋
Problem
The
fetchURL
function sets the loading and result states in an asynchronous callback. If the component has been unmounted in the meantime, this results to a memory leak.Reproduction
Just put the
ReactTinyLink
component in a modal, close the modal before the fetch is done "et voilà" 🚰Possible fix
You could use a cleanup function in your
useEffectAsync
which cancels the fetch and sets a variable which prevents thefetchURL
to set the state.The text was updated successfully, but these errors were encountered: