react 使用 PersistGate 白屏解决方案

我在全局添加 PersistGate 组件后报错了

报错信息如下:

Uncaught Error: A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.

未捕获错误:组件在响应同步输入时挂起。这将导致UI被加载指示器替换。要修复此问题,应使用startTransition包装挂起的更新。

解决方法:

全局加入 Suspense 即可

相关推荐
zzzzzz31014 分钟前
react-bits:酷炫组件之外,React 页面表现力真正该怎么借力?
react.js·开源·动效
Emily156853598702 小时前
Emerson 1C31129G03 Analog Input Module
java·开发语言·前端·plc·emerson·1c31129g03·input module
To_OC7 小时前
面试被问了三回三栏布局,这次我终于把 BFC 那层窗户纸捅破了
前端·css·面试
To_OC8 小时前
啃完 TS 工具类型我发现:Pick 和 Omit 原来就是一层窗户纸
前端·面试·typescript
风月说与山鬼9 小时前
三、大括号语法
前端·react.js
kyriewen9 小时前
我把最常踩的8个CORS跨域报错整理了一遍——第8个去年还不存在
前端·javascript
Csvn10 小时前
🕰️ 闭包 + setTimeout 的 5 个经典陷阱:为什么定时器看到的永远不是最新的值?
前端
lilian23310 小时前
Harmony os 技术实战|拼豆制图27:用单字符编码承载 50 张 70×70 图纸
前端·数据库·华为·harmonyos
CarIise11 小时前
CSS选择器与样式关联
前端·css·tensorflow