I was following a course on udemy on react components and I was met with this Syntax error.
I have the following dependencies installed using yarn: "dependencies": { "babel-preset-env": "1.5.2", "babel-preset-react": "6.24.1" }
Here's myJSX file:
class Header extends React.Component {
render() {
return <p>This is from header</p>;
}
}
const jsx = (
<div>
<h1>Title</h1>
<Header />
</div>
);
ReactDOM.render(jsx, document.getElementById('app'));
I am using this command to convert this to the main JS file:
babel src/app.js --out-file=public/scripts/app.js --preset=env,react --watch
Please let me Know what I am doing wrong here