Tag: reactjs

[ANSWERED] javascript – import statement gives a syntax error saying “Cannot use import statement outside a module”

Solution 1 : As per https://reactjs.org/docs/add-react-to-a-website.html, you need to add these two lines to your HTML file before importing your script: <script src="https://unpkg.com/[email protected]/umd/react.development.js" crossorigin></script> <script src="https://unpkg.com/[email protected]/umd/react-dom.development.js" crossorigin></script> I’m not sure…