Error: A component suspended while responding to synchronous input...

2023-05-16

解决报错:The above error occurred in the <Route.Provider> component:

外层添加Suspense即可解决

import { lazy, Suspense } from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
// 这里路由采用了浏览器模式
import { BrowserRouter as Router } from 'react-router-dom'
// 一定引入antd的样式
import 'antd/dist/reset.css';

const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
 <Suspense> //外层添加
    <Router>
      <App />
    </Router>
 </Suspense> 
)

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Error: A component suspended while responding to synchronous input... 的相关文章

随机推荐

  • react实现点击复制

    1 使用浏览器提供的document execCommand 39 copy 39 2 使用copy to clipboard库 document execCommand 34 copy 34 1 document execCommand封
  • zustand

    最近工作中需要用到zustand xff0c 先记录一下学到的demo 安装 xff1a npm install zustand 公共文件store引入 import create from 39 zustand 39 const useS
  • antd获取表单的所有数据

    当我们使用antd的组件的form 表单时 xff0c 数据一般在form中的onFinish 61 onFinish 方法上可以拿到 const Demo 61 61 gt const onFinish 61 values any 61
  • antd使用阿里巴巴矢量图标

    最近需要在antd引入中阿里矢量图标 xff0c 看到几个关于antd使用iconfont的回答 xff0c 其中关于Icon的引入 xff0c 都是写的从antd引入 xff08 不可用 xff09 旧版本 xff1a import Ic
  • antd表单赋值,回显表格数据

    使用 antd 做表格回显数据时 xff0c 会看到文档有写 xff1a 所以我们可以 1 定义hooks const form 61 Form useForm 2 在触发事件中使用 xff0c 以打开模态框赋值为例 const showM
  • react反向代理配置

    官网 xff1a https create react app dev docs proxying api requests in development 安装 npm install http proxy middleware save
  • js立即执行函数写法

    优点 xff1a 1 立即执行 xff0c 不用担心临时变量污染全局变量 xff0c 减少命名 2 方便封装 写法 xff1a function name params console log params 打印 1 1 function
  • uboot的环境变量-2.9.uboot源码分析5-朱有鹏-专题视频课程

    uboot的环境变量 2 9 uboot源码分析5 3347人已学习 课程介绍 本课程为uboot学习的第9部分 xff0c 主要讲解uboot的环境变量的实现原理和环境变量在内存中 SD卡中的存储方法 结合环境变量相关的几个命令的代码分析
  • 输出什么呢?

    let normaLize 61 function params let arr 61 params split g filter v 61 gt v let result 61 let obj 61 result while key 61
  • Pormise

    Promise是一个构造函数 三种状态 xff1a pending xff08 进行中 xff09 fulfilled xff08 已成功 xff09 和rejected xff08 已失败 xff09 xff0c fulfilled和re
  • js删除对象的某个属性

    第一种 xff1a delete const obj 61 name 39 章三 39 age 18 删除age这个属性 delete obj age console log obj name 39 章三 39 第二种 xff08 ES6
  • moment时区转换

    moment js 时区转换 根据本地时区 moment 34 2022 05 31T16 00 00 000Z 34 format 39 YYYY MM DD 39 39 2022 06 01 39
  • TypeScript

    安装 npm install g typescript 安装完成后 xff0c 在控制台运行如下命令 xff0c 检查安装是否成功 3 x xff1a tsc V vscode自动编译 1 生成配置文件tsconfig json tsc i
  • 数组中第一个不重复的值

    var firstUniqChar 61 function s const arr 61 countBy s for const i k of Array from s entries if arr k 61 61 61 1 return
  • JS中数组转字符串,字符串转数组方法合集

    一 字符串转数组 xff1a 1 Array split const str 61 39 hello 39 str split 39 39 39 h 39 39 e 39 39 l 39 39 l 39 39 o 39 const str2
  • React和Vue 父组件调用子组件的方法

    react 父组件 xff1a 使用createRef和useRef都可以 import useRef from 39 react 39 let ChildRef 61 useRef function handleOnClick Child
  • Utils

    平级数组转为树状 const dataTree 61 id 1 name 39 总公司 39 parentId 0 id 2 name 39 深圳分公司 39 parentId 1 id 3 name 39 北京分公司 39 parentI
  • meraid的memo

    首先安装mermaid和antd xff0c 即可复制下面代码在react中实现demo效果 import React from 39 react 39 import Input from 39 antd 39 import mermaid
  • linux中的文件IO-3.1.linux应用编程和网络编程第1部分-朱有鹏-专题视频课程

    linux中的文件IO 3 1 linux应用编程和网络编程第1部分 10350人已学习 课程介绍 本课程主要讲解linux中的文件读写和IO处理 xff0c 包括API的概念 open函数的重要flag linux内核管理文件的原理 in
  • Error: A component suspended while responding to synchronous input...

    解决报错 xff1a The above error occurred in the lt Route Provider gt component 外层添加Suspense即可解决 import lazy Suspense from 39