navigate() isn’t working after async operation.
I have this function to handle submit event of a form. In this function I am making an api call to save the data in backend and after awaiting that api call I am using navigate to /something route. But somehow it is not working and if I remove await from that api call then it works.
Any idea why this might be happening ?
This is my Function. It is just not working with awaiting addRole function. If I use the commented part and await the Promise with setTimeout then It is working properly.
Any idea why this might be happening ?
This is my Function. It is just not working with awaiting addRole function. If I use the commented part and await the Promise with setTimeout then It is working properly.
