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 am beginner developer and this might be a dumb question. All I want is to call a function after getting a response.
My current solution is to use useEffect:
useEffect(() => {
if (!postLoading) {
// Calling my function
}
}, [postLoading]);
I don't know if that is a good way or not, but I would prefer to do it something like this:
executePost({
data: {
// My data
}
}).then( /*Calling my function*/);
The second solution in VS Code spits out error "Property 'then' does not exist on type 'void'.".
Is there a way to do this with axios hooks?
The text was updated successfully, but these errors were encountered:
I am beginner developer and this might be a dumb question. All I want is to call a function after getting a response.
My current solution is to use useEffect:
I don't know if that is a good way or not, but I would prefer to do it something like this:
The second solution in VS Code spits out error "Property 'then' does not exist on type 'void'.".
Is there a way to do this with axios hooks?
The text was updated successfully, but these errors were encountered: