Accepted answer

You need to transpile to es2015 since most of the browsers do not natively understand modern JS.

loaders: [
            test: /\.js$/,
            exclude: /node_modules/,
            loader: 'babel-loader',
            query: {
                presets: ['es2015', 'stage-0', 'react']

Add a loader to your webpack config. It should work then.


In your package.json replace the script tag with

  "scripts": {
    "start": "webpack-dev-server --hot"

and install "webpack-dev-server --hot" using npm install webpack-dev-server --hot

And run your app using

npm start

Also you need to enclose your code in tag inside return as

 render() {

     return (
       <Provider store={store}>

and make sure you have installed all the babel dependencies to compile your code

Related Query

More Query from same tag