VSCODE 在写React组件的过程中,使用ES6的写法,组件名会有红色波浪线,鼠标hover上去会看到一个警告。
[js] Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove
this warning.
解决办法是在根目录创建一个 tsconfig.json 文件
// tsconfig.json
{
"compilerOptions": {
"experimentalDecorators": true,
"allowJs": true
}
}