I am trying to learn React. I am trying to display the string Hello World but get the following error in my browser:
Module build failed (from ./node_modules/babel-loader/lib/index.js): SyntaxError: C:\react\react-app\src\index.js: Missing semicolon. (1:6)
And I get these errors in my Editor: 1)'import ... =' can only be used in TypeScript files. 2)'=' expected. 3)';' expected.
My code is as follows:
import React from "react";
import ReactDom form "react-dom";
const element = <h1>Hello World</h1>;
ReactDom.render(element, document.getElementById('root'));
I would appreciate any help.
frominstead ofform.