[Solved] How to make an API request with React? [closed]


Fastest way to resolve this type of CORS problem is to add an entry in your hosts file mapping localhost to some address and develop from there. Obviously, this is a quick and dirty solution (since it only fixes the problem on your local machine) but if you’re developing a small project for your own learning then it’s a not a bad way to do it.

127.0.0.1 your_custom_address

I did run your code and it worked fine.

1

solved How to make an API request with React? [closed]