Issues getting 'hello world' with React

@cbogues 4 months ago

I'm having trouble getting Hello World printed with the React tutorial below is my code:

import './styles.scss';
import React from 'react';
import ReactDOM from 'react-dom';

const root = document.getElementById('app-container');

ReactDOM.render( <p>Hello world!</p>, root);

Here is the error:`[./src/app.js] ./src/app.js 765 bytes {0} [built] [failed] [1 error] [0] + 73 hidden modules [0] [0] ERROR in ./src/app.js [0] Module build failed: SyntaxError: Unexpected token (7:17) [0] [0] 5 | const root = document.getElementById('app-container'); [0] 6 | [0] > 7 | ReactDOM.render(

Hello world!

, root); [0] | ^ [0] [0] @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/app.js [0] Child html-webpack-plugin for "index.html": [0] chunk {0} index.html 541 kB [entry] [rendered] [0] [./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html] ./~/html-webpack-plugin/lib/loader.js!./src/index.html 606 bytes {0} [built] [0] [./node_modules/lodash/lodash.js] ./~/lodash/lodash.js 540 kB {0} [built] [0] [./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 509 bytes {0} [built] [0] [./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 517 bytes {0} [built] [0] webpack: Failed to compile.

`

Alex Sears 3 months ago

Hello!

Do you have this code up anywhere I could take a look at it?