react component 语法报错解决
时间:2017-05-29 13:13:35
收藏:0
阅读:320
React es6语法
class Counter extends Component {
static propTypes = {
报错。
两个解决方案:
1.等号改为冒号,但是看着别扭
2.yarn add babel-preset-stage-0
{
"presets": ["react", "es2015", "stage-0"]
}
原文:http://www.cnblogs.com/ignacio/p/6917828.html
评论(0)