We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
该工程骨架目前使用都正常,但是发现拷antd pro的示例模块过来报错,例如:
class LoginDemo extends React.Component { state = { notice: '', type: 'tab2', autoLogin: true, } onTabChange = (key) => { this.setState({ type: key, }); } render() { return ( <Login defaultActiveKey={this.state.type} onTabChange={this.onTabChange} > <a style={{ float: 'right' }} href="">注册账户</a> </Login> ); } }
问题:
尝试了安装babel-preset-stage-0或babel-preset-es2017,然后在.babelrc 里的presets 添加stage-0或es2017,这样也不行,重启webpack进行编译依然报错。
babel-preset-stage-0
babel-preset-es2017
.babelrc
presets
stage-0
es2017
The text was updated successfully, but these errors were encountered:
@beautycss 这个好像是 eslint 的错误,可以关掉eslint 试试:
loaders:{ eslint: false }
如果OK,再回过头来修复 eslint试试
Sorry, something went wrong.
我也遇到同样的问题,我的是加载css报的错。 我尝试关闭eslint 还是报同样的错
这事 我加 mobx 时候也是 找了很久 加了 transform-class-properties transform-decorators-legacy 好像可以 babel 这鬼东西 真头大
{ "presets": [ "react-latest", ["env", { "modules": false }] ], "plugins": [ "transform-decorators-legacy", "react-hot-loader/babel", "transform-object-assign", "syntax-dynamic-import", "transform-object-rest-spread", "transform-class-properties", ["import", { libraryName: "antd", style: "css" }] ], "comments": false }
No branches or pull requests
该工程骨架目前使用都正常,但是发现拷antd pro的示例模块过来报错,例如:
问题:
可能是目前不支持ES7的方式写React;
尝试了安装
babel-preset-stage-0
或babel-preset-es2017
,然后在.babelrc
里的presets
添加stage-0
或es2017
,这样也不行,重启webpack进行编译依然报错。The text was updated successfully, but these errors were encountered: