SyntaxError: Cannot use import statement outside a module in react code example
Example: SyntaxError: Cannot use import statement outside a module
Node.js >= v13
Save the file with .mjs extension, &
Add { "type": "module" } in the nearest package.json.
(run npm init to create package.json)