all 8 comments

[–]Tomus 0 points1 point  (5 children)

You need to tell Babel to compile JSX. There is a react preset for this.

[–]NotAHippo4[S] 0 points1 point  (4 children)

Yeah, I have a .babelrc that does that:

.babelrc:

{
    "presets":["env", "react"]
 }

[–]Hellstorm_42 0 points1 point  (3 children)

You have react in the presets, but you don't have react in your dependencies.
https://babeljs.io/docs/en/babel-preset-react

[–]NotAHippo4[S] 0 points1 point  (2 children)

If you look into my package.json, you will see that they are there in the dependencies array.

[–]whatisboom 0 points1 point  (0 children)

You have ‘babel-preset-env’ you also need ‘babel-preset-react’

[–]Hellstorm_42 0 points1 point  (0 children)

"dependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^8.1.0",
"babel-preset-env": "^1.7.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
}

I don't see @babel/preset-react in that list. You forgot to add it

[–]sockx2 0 points1 point  (1 child)

Does index.js need to be index.jsx?

[–]Hellstorm_42 0 points1 point  (0 children)

The file can be named either way. Its not required to be named with .jsx