Arrow Function syntax not working with webpack?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm making an app on react-redux. I'm using webpack for bundling and babel for transpiling. When I am try to use arrow function in my code. It gives me error as : Module build failed: SyntaxError: Unexpected token (34:15) }; > handleSubmit = (event) => { ^ event.preventDefault(); this.props.dispatch(actions.addTodo(this.state.inputText)); My webpack configuration file looks like as follows : module.exports = { devtool: 'inline-source-map', entry: [ 'webpack-hot-middleware/client', './client/client.js' ], output: { path: require('path')