我想在使用semantic-ui时使模板的组件分解并获得编译错误。 (意外的令牌(11:12))创建React组件,返回部分语义UI网格行
您可能需要一个合适的加载程序来处理此文件类型。
import React, { Component } from 'react';
import { Container, Label, Grid } from 'semantic-ui-react'
export default class StatusLine extends Component {
constructor(props) {
this.state = props.fyrevm;
}
render() {
return (
<Grid.Row>
<Grid.Column width={8}>
<Container textAlign='right'>
<Label sub>Score</Label><span>{this.state.score}</span>
<Label sub>Turn</Label><span>{this.state.turn}</span>
<Label sub>Time</Label><span>{this.state.time}</span>
</Container>
</Grid.Column>
</Grid.Row>
);
}
}
我会对主要问题发表评论。无状态你的意思是不使用this.state,只使用道具参数? (仍然不会用super();)编译。 –