React - Module parse failed

You need add babel-loader, with react preset, do the following steps

  1. npm i --save-dev babel-loader babel-preset-react babel-preset-es2015
  2. add to webpack.config.js configs for babel-loader ( to loaders: [..] section)

    {  
       test: /\.jsx?$/,
       exclude: /(node_modules)/,
       loader: 'babel',
       query: {
          presets: ['react', 'es2015']
       }
    }
    

Update: babel-preset-es2015, babel-preset-react was deprecated in favor of using @babel/env and @babel/preset-react

  1. npm i --save-dev babel-loader @babel/core @babel/preset-react @babel/preset-env
  2. add to webpack.config.js configs for babel-loader
  rules: [
    {
      test: /\.jsx?$/,
      exclude: /(node_modules)/,
      use: {
        loader: 'babel-loader',
        options: {
          presets: ['@babel/preset-env', '@babel/preset-react']
        }
      }
    }
  ]