Dealing with CORS in "Create React App"

Hi Zsolt, great React course!

I want to profound my knowledge about React.
I was searching for “how to deal with CORS in React.js”, but I didn’t found the answer.

As far I understand we need to create an intermediate server with

dependencies:  {

Error example:

Access to XMLHttpRequest at '' from origin '' has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.

I hope that you could maybe point me to some solution.

Thank you

1 Like

Thanks, I’m glad you like the course.

Yes, you may need to use a proxy for eliminating CORS errors.

While you are experimenting on localhost, you can simply enable some urls, ports in package.json. Example:

Further reading on the generic, when you are not just developing, but you also host: