Lets say I have some react components on domain-a.com.

From domain-b.com, an applications calls an API endpoint on domain-a.com. This end point returns the .js of the above mentioned react components (bundled). These are then executed on domain-b.com. The react components render a UI and call some end points on domain-a.com.

Is there any CORS issues with domain-b.com running those components on its own domain. I am basically trying to create cross-domain react components and trying to figure out what is the easiest way to go about this without hitting security issues.

  • ReactJs is just JavaScript. Look for problems regarding CORS and Javascript and you have your answer. – Berin Loritsch Jul 3 '18 at 17:43
  1. Yes, CORS is bound to occur if you are requesting for resources from another origin due to security concerns. Good article to understand - http://restlet.com/company/blog/2015/12/15/understanding-and-using-cors/

  2. other way you can call your backend and let him handle all the heavy lifting. enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.