【发布时间】:2017-01-31 18:11:44
【问题描述】:
我已经根据 JsDoc 的文档定义了类、属性、方法,但我得到的错误是:无法解析“/somePath”:意外的令牌。我的类定义如下:-
/**
* class representing Lab testResults
* @param {object} props: contain all the property
*/
class LabTestResult extends Component {
constructor(props) {
super(props);
this.state = {
loading: true,
}
this.collapseButton = this.collapseButton.bind(this);
}
state = {
open: false,
};
}
为什么我会收到此错误?我该如何解决这个问题?请帮助我。
【问题讨论】:
-
state = {open: false};在 ES6 中无效。我不希望 jsdoc 支持所有实验性功能。
标签: reactjs ecmascript-6 jsdoc