This is a project for development purposes only, it consists of 2 files only: index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>React Calculator</title>
</head>
<body>
<div id="root"></div>
<!-- React CDN -->
<script
crossorigin
src="https://unpkg.com/react@18/umd/react.development.js"
></script>
<!-- ReactDOM CDN -->
<script
crossorigin
src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"
></script>
<!-- App Component -->
<script src="./app.js"></script>
</body>
</html>
app.js
const App = () => {
return (<h1>Hello, World!</h1>)
};
ReactDOM.render(<App />, document.getElementById('root'));
I got this error:
Uncaught SyntaxError: Unexpected token '<' (at app.js:2:11)
Can someone help me to see what is wrong?