I have some react js code, which if I embed it in my index.html works fine. But when I try to reference that code from an external .jsx file, it fails to access that code and throws an error. Please help.
This is how I am referencing the jsx file
<script type="text/jsx" src="autocomplete_js/custom_react.jsx">
These are the errors I get:
Resource interpreted as Script but transferred with MIME type text/plain: "file:///C:/react/autocomplete_js/custom_react.jsx"
XMLHttpRequest cannot load file:///C:/react/autocomplete_js/custom_react.jsx. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource