无法在React + MUI中使用WebStorm。

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

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:

function UserInputBox() {
    return (
        <Box
            display="flex"
            flexDirection="column"

            alignItems="center" p={5} boxShadow={3}
        >
            <Box
                p={5}
                sx={{background: "blue", alignItems: "stretch"}}
            >
                <h1>User Input</h1>
            </Box>

            <Stack spacing={2}>
                <TextField label="Username" />
                <TextField label="Age (Years)" />
                <Button
                    variant="contained"
                    sx={{borderRadius: 28, textTransform: "none"}}
                >
                    Add User
                </Button>
            </Stack>
        </Box>
    )
}

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:

function UserInputBox() {
    return (
        <Box
            display="flex"
            flexDirection="column"

            alignItems="center" p={5} boxShadow={3}
        >
            <Box
                p={5}
                sx={{background: "blue", alignItems: "stretch"}}
            >
                <h1>User Input</h1>
            </Box>

            <Stack spacing={2}>
                <TextField label="Username" />
                <TextField label="Age (Years)" />
                <Button
                    variant="contained"
                    sx={{borderRadius: 28, textTransform: "none"}}
                >
                    Add User
                </Button>
            </Stack>
        </Box>
    )
}

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:

确定