【问题标题】:Very slow intellisense when using MUI in VS Code在 VS Code 中使用 MUI 时智能感知非常慢
【发布时间】:2021-12-25 03:17:43
【问题描述】:

我正在将 MUI 用于 React 项目,而智能感知在速度方面给我带来了问题。建议不会在 4-5 秒内出现,我猜 MUI 的庞大库与它有关。有没有办法专门为 MUI 禁用智能感知?如果没有,我还有什么方法可以加快智能感知?

package.json

"dependencies": {
  "@emotion/react": "^11.5.0",
  "@emotion/styled": "^11.3.0",
  "@mui/icons-material": "^5.0.5",
  "@mui/material": "^5.0.6",
  "@testing-library/jest-dom": "^5.15.0",
  "@testing-library/react": "^11.2.7",
  "@testing-library/user-event": "^12.8.3",
  "axios": "^0.24.0",
  "chart.js": "^3.6.0",
  "react": "^17.0.2",
  "react-chartjs-2": "^3.3.0",
  "react-dom": "^17.0.2",
  "react-reveal": "^1.2.2",
  "react-router": "^6.0.1",
  "react-router-dom": "^6.0.1",
  "react-scripts": "4.0.3",
  "web-vitals": "^1.1.2"
}

【问题讨论】:

  • 我放弃 VScode 转而使用 Intellij IDEA 的原因之一。另请参阅this 问题。

标签: reactjs visual-studio-code material-ui intellisense


【解决方案1】:

也许使用this extension 很有用。

【讨论】:

    【解决方案2】:

    尝试直接从组件导入,而不是从整个库导入。我发现只要不从整个库中导入任何组件,文件中的导入就会快得多。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-10-18
      • 2019-12-08
      • 1970-01-01
      • 2017-06-06
      • 2018-05-21
      • 1970-01-01
      • 2022-10-05
      • 1970-01-01
      相关资源
      最近更新 更多