提问人:night_thinker 提问时间:8/7/2023 更新时间:8/7/2023 访问量:56
在创建构建文件之前,我必须删除 <React.StrictMode>吗?
do I have to remove <React.StrictMode> before creating build file?
问:
我想为我的 react 应用程序创建构建文件,并且我不希望组件在其中渲染两次,因此在运行以下命令之前我必须删除:<React.StrictMode>
npm 运行构建
答:
1赞
Galbert
8/7/2023
#1
使用 后无需删除 。React 禁用了生产构建的严格模式。React.StrictMode
npm run build
Although the Strict Mode checks only run in development, they help you find bugs that already exist in your code but can be tricky to reliably reproduce in production. Strict Mode lets you fix bugs before your users report them.
评论