Hi @jadhavni3 ,
It seems like either your api is not responding or not responding with the correct JSON format that you are using in React.
This thing you can validate in ARC or Postman then modify your API accordingly. but for sure it is not generic to AEM this purely you code or configuration issue.
I think we should avoid such kind of questions here.
Umesh Thakur