[英]React App is not reloading when code changes are saved
When i do some updates on the code and save them the react app seems not to be functional, it stops and the mouse clicks seems not to be working.当我对代码进行一些更新并保存它们时,反应应用程序似乎无法正常工作,它停止并且鼠标点击似乎不起作用。 I'm obliged to manually refresh the page.
我不得不手动刷新页面。 This is my package.json:
这是我的 package.json:
"dependencies": {
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^12.8.3",
"@webiny/ui": "^5.22.1",
"axios": "^0.21.1",
"firebase": "^9.6.10",
"material-ui": "^0.20.2",
"moment": "^2.29.3",
"npm": "^7.7.6",
"react": "^16.14.0",
"react-accessible-accordion": "^4.0.0",
"react-bootstrap": "^1.6.4",
"react-chartjs-2": "^4.1.0",
"react-dom": "^17.0.1",
"react-firebaseui": "^4.1.0",
"react-fontawesome": "^1.7.1",
"react-giphy-picker": "^1.1.1",
"react-icons": "^4.3.1",
"react-modal": "^3.14.3",
"react-paginate": "^7.1.3",
"react-redux": "^8.0.0",
"react-router-dom": "^5.3.1",
"redux": "^4.2.0",
"web-vitals": "^1.1.1"
},
"scripts": {
"start": "PORT=5000 react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
I'm using VS code on linux Ubuntu 20我在 linux Ubuntu 20 上使用 VS 代码
Try doing the the following changes.尝试进行以下更改。
If you're using npm如果您使用的是 npm
"overrides" : {
"react-error-overlay": "6.0.9"
}
If you are using yarn如果您使用的是纱线
"resolutions" : {
"react-error-overlay": "6.0.9"
}
After doing this, do install the packages once again and re-start the app.完成此操作后,再次安装软件包并重新启动应用程序。 This should help
这应该有帮助
Tips on VS Code: You can enable autosave, so when any change code in your codebase, VS Code will automatically do it for you and you don't need to do it manually every time. VS Code 小贴士:您可以启用自动保存,这样当您的代码库中有任何更改代码时,VS Code 会自动为您完成,您无需每次都手动执行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.