I've had some issues using fat arrow functions in react. If the function is not anonymous, it complains about the syntax and won't compile.
This:
handleItemClick = (e, { name }) => this.setState({ activeItem: name });
Gives me:
BabelLoaderError: SyntaxError: Unexpected token (20:20)
It points to the equal sign(handleItemClick'=').
This however works just fine:
onClick={ (arg) => {//Do something} };
Is there something wrong with my webpack config, or something else i'm missing? Thankful for any hints.
module.exports = {
  entry: PATHS.app_path,
    output:{
        path: PATHS.build,
        filename: 'index.js'
    },
    devServer:{
        inline: true,
        port: 3333,
        contentBase: PATHS.build,
        publicBase: PATHS.build,
        historyApiFallback: true
    },
    resolve: {
        root: path.resolve('./public'),
        extensions: ['', '.js', '.jsx']
    },
    module: {
        loaders: [
            {
                test: /\.jsx?$/,
                exclude: /(node_modules|bower_components)/,
                loader: 'babel',
                query: {
                    presets: ['es2015', 'react']
                }
            },
            {
                test: /\.css$/,
                loader: 'style-loader'
            },
            {
                test: /\.css$/,
                loader: 'css-loader',
                query: {
                    modules: true,
                    localIdentName: '[local]'
                    //localIdentName: '[name]__[local]___[hash:base64:5]'
                }
            },
            { test: /\.(png|woff|woff2|eot|ttf|jpg)$/, loader: 'url-loader?limit=100000' },
            {
                test: /.*\.svg$/,
                loaders: [
                    'file-loader',
                    'svgo-loader?' + svgoConfig,
                ]
            }
        ]
    }
};
 
    