學習反應,我期待在谷歌的MaterialUI文檔,它顯示了一個語法看起來像:這是什麼JavaScript ES6語法?
ERROR in ./client/App.jsx
Module build failed: SyntaxError: Unexpected token (23:8)
21 | }
22 |
> 23 | state = {
| ^
24 | open: false,
25 | };
26 |
:
export default class DialogExampleModal extends React.Component {
state = {
open: false,
};
handleOpen =() => {
this.setState({open: true});
};
...
巴貝爾與ES2015是在這段代碼的狀態=部分失敗
我的問題是,這是什麼語法,我有可能配置錯誤的東西?看來其他ES2015語法工作正常。
您在第21行缺少分號。 – cdhowie