在运行我的react项目时,我遇到了编译webpack的错误,如下所示:
ERROR in ./src/dispatcher-dev/App.js 17:20
Module parse failed: Unexpected token (17:20)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| class App extends Component {
> componentDidMount = () => {
| // Check the type of browser and add a class accordingly to the body
| let browser = (function(){
@ ./src/dispatcher-dev/index.js 7:0-24 10:36-39
@ multi ./src/dispatcher-dev/index.js我已经在我的webpack和react-dom和prop-types中加入了babel-loader。
有谁可以帮我?
发布于 2020-03-04 23:25:34
没有可能在js类中添加静态属性。
要使用这些功能,您应该添加this插件到您的babel
https://stackoverflow.com/questions/60520475
复制相似问题