Very slow intellisense when using MUI in VS Code
Asked Answered
B

3

7

I'm using MUI for a react project and intellisense is giving me problems when it comes to speed. Suggestions won't show up for up to 4-5 seconds and I'm guessing MUI's massive library has something to do with it. Is there a way to disable intellisense for MUI specifically? If not, are there any more ways I can speed up intellisense?

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"
}
Bisector answered 12/11, 2021 at 20:17 Comment(1)
One of the reasons I ditched VScode in favor of Intellij IDEA. Also see this issue.Stylographic
S
1

Try importing directly from the component, rather than the whole library. I have found as long as no components are imported from the whole library, imports in a file are much faster.

import screenshot

Snooperscope answered 13/12, 2021 at 4:23 Comment(0)
S
0

You should import it like this

import Tab from '@mui/material/Tab';

instead of:

import {Tab} from '@mui/material';

They might look similar, but the second one is importing the whole library and then extracting the Tab component, instead of just getting the component at once. That should help with performance.

Suh answered 8/2, 2022 at 12:44 Comment(0)
W
-2

Maybe using this extension is useful.

Wellstacked answered 12/12, 2021 at 9:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.