React native & MobX:对装饰器的实验性支持是一个主题[...]。但是 'tsconfig' 或 'jsconfig' 不存在

React native & MobX: Experimental support for decorators is a feature that is subject [...]. But 'tsconfig' or 'jsconfig' doesn't exist

所以当我尝试将 mobx observer 实现为 react native 时,我的 vscode 一直给我这个错误。

Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.

我相信我已遵循以下网站中的每条说明。

https://jamesmargrove.medium.com/setting-up-a-typescript-react-native-project-with-decorators-93eb8a8ffa9

而且我在项目中的任何地方都找不到 tsconfigjsconfig。请帮忙

尝试在项目的根目录中添加一个 jsconfig.json 文件,内容如下:

{
  "compilerOptions": {
    "experimentalDecorators": true
  }
}