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
Hi, #16 solves the problem of not updating the state after umounting by canceling the call.
However sometimes it desiderable to run the call when the component is unmounted (ex autosave on close). It could be resolved with an option allowing axios to run after unmount, but not setting the results in the state variables. If anybody thinks this is the correct approach I could try to write a patch.
The text was updated successfully, but these errors were encountered:
The state of axios shouldn't be affected by the react state, therefore I don't see problems in the network call. Instead all side effects (result data, loading state, error) do cause problems, but it should be easy to avoid them since we are no more interested. In our code (we wrote an internal hook similar to this one) we just have a flag allowing to run the network call after unmont, but skipping any state change.
Otherwise any behavior like autosave on close becames very difficult
Hi, #16 solves the problem of not updating the state after umounting by canceling the call.
However sometimes it desiderable to run the call when the component is unmounted (ex autosave on close). It could be resolved with an option allowing axios to run after unmount, but not setting the results in the state variables. If anybody thinks this is the correct approach I could try to write a patch.
The text was updated successfully, but these errors were encountered: