无法在React + MUI中使用WebStorm。

huangapple go评论91阅读模式
英文:

Impossible to use WebStorm with React + MUI

问题

I am using WebStorm 2022 with React, JavaScript and MUI -- and I have been getting insanely slow performance, that it's become impossible to use.

Autocomplete takes around 6-7 seconds to load, and my CPU usage rockets up to 100% whenever I type anything in my JSX file.

Example code:

  1. function UserInputBox() {
  2. return (
  3. <Box
  4. display="flex"
  5. flexDirection="column"
  6. alignItems="center" p={5} boxShadow={3}
  7. >
  8. <Box
  9. p={5}
  10. sx={{background: "blue", alignItems: "stretch"}}
  11. >
  12. <h1>User Input</h1>
  13. </Box>
  14. <Stack spacing={2}>
  15. <TextField label="Username" />
  16. <TextField label="Age (Years)" />
  17. <Button
  18. variant="contained"
  19. sx={{borderRadius: 28, textTransform: "none"}}
  20. >
  21. Add User
  22. </Button>
  23. </Stack>
  24. </Box>
  25. )
  26. }
  27. export default UserInputBox
英文:

I am using WebStorm 2022 with React, JavaScript and MUI -- and I have been getting insanely slow performance, that it's become impossible to use.

Autocomplete takes around 6-7 seconds to load, and my CPU usage rockets up to 100% whenever I type anything in my JSX file.

Example code:

  1. function UserInputBox() {
  2. return (
  3. <Box
  4. display="flex"
  5. flexDirection="column"
  6. alignItems="center" p={5} boxShadow={3}
  7. >
  8. <Box
  9. p={5}
  10. sx={{background: "blue", alignItems: "stretch"}}
  11. >
  12. <h1>User Input</h1>
  13. </Box>
  14. <Stack spacing={2}>
  15. <TextField label="Username" />
  16. <TextField label="Age (Years)" />
  17. <Button
  18. variant="contained"
  19. sx={{borderRadius: 28, textTransform: "none"}}
  20. >
  21. Add User
  22. </Button>
  23. </Stack>
  24. </Box>
  25. )
  26. }
  27. export default UserInputBox

答案1

得分: 1

由于WebStorm中的错误,出现了这个问题。他们已经修复了它,可能会在下一个EAP构建版本中发布。请查看下面的链接以获取更多信息。
https://youtrack.jetbrains.com/issue/WEB-59766/Very-slow-code-analysis-in-React-MUI-Javascript-code

英文:

That was due to the bug in webstorm. They had fixed it and will probably comes in the next EAP build. Check below link for activity.
https://youtrack.jetbrains.com/issue/WEB-59766/Very-slow-code-analysis-in-React-MUI-Javascript-code

答案2

得分: 0

我在我的 Mac 上遇到了相同的问题。解决方案是简单地安装版本2022.2,而不是2022.3。

英文:

I had the same problem on my mac. The solution is to simply install version 2022.2 instead of 2022.3

huangapple
  • 本文由 发表于 2023年2月18日 08:21:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/75490342.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定