我希望能够在代码沙箱中的打字代码中使用mobx的@observer。然而,我得到了这个错误:
/src/content.tsx:当前未启用对实验性语法‘装饰器-遗留’的支持(6:1):
4 | import { observer } from "mobx-react";
5 |
> 6 | @observer
| ^
7 | export class Particle extends React.Component {我已经做到了:
1)添加依赖项

2)添加包含以下内容的.babelrc文件

但是我不能摆脱这个错误。我怎么才能修复它?
发布于 2019-07-30 02:21:11
将此代码添加到tsconfig.json:
"compilerOptions": {
"experimentalDecorators": true发布于 2021-07-27 09:46:09
转到File > Preference > Settings > Search "experimental"
然后检查Javascript › Implicit Project Config: Experimental Decorators
https://stackoverflow.com/questions/54317721
复制相似问题