DEV Community

AFSIDD
AFSIDD

Posted on

React 18 Twice Mounting and API Calls

I'm using React 18 as front end & Laravel 10 as backend. Now the issue is that i'm not allowed to do concurrent calls to api's so when react mount and re-mounts the second api call gets rejected. I have also user AbortSignal but it still sends the call to the server. Any Suggestion on how to resolve this?

Top comments (1)

Collapse
 
chubinashvili profile image
Zura Chubinashvili

It only mounts twice when you are running your app on development mode (meaning locally) and at the same time you're using strict mode