Im currently doing the 'learn react' course on scrimba. I've run into a problem at the very beginning
import React from 'react';
import ReactDOM from 'react-dom';
ReactDOM.render(<h1>Hello world</h1>, document.getElementById("root"))
When I try to run the code above (in atom), i get 'Command not configured for JavaScript (JSX)!' error. Also when i created a react project, after opening the default .js files I got the same error. Any help appreciated!
update: changing filename to .jsx 'fixed' the above error but now im getting
SyntaxError: /Users/dmccaul/.atom/packages/script/node_modules/.bin/babel: Unexpected token (4:16)
2 | import ReactDOM from 'react-dom';
3 |
> 4 | ReactDOM.render(<h1>Hello world</h1>, document.getElementById("root"))
| ^
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…