那些年遇到的BUG
文章平均质量分 55
DmzLuckyDog
这个作者很懒,什么都没留下…
展开
-
JS中坑——sort()函数
错误展示 function fun1(nums) { let res = [...new Set(nums)]; for(let i =0 ;i <res.length ;i++){ res[i] = Number(res[i]); console.log(); } res.sort(); //(10) [1, 10, 11, 2, 3, 4, 5, 6, 7, 8] if(res[2] >res[res.length-1] ){原创 2021-10-06 18:28:54 · 294 阅读 · 0 评论 -
React中遇到的bug——React数组push后作为table数据无法显示
错误展示上面一张图表格数据源是push的数组,下面图片是正常数据源错误代码state中的 // 暂存所有数据 arr: [], alldata: { pages: 0, total: 0, current: 1, records: [], },页面加载数据 loadallData = () => { const obj = { isvName: '',原创 2021-07-20 18:00:02 · 1831 阅读 · 1 评论 -
React中遇到的Bug——Unhandled Rejection (Error): Maximum update depth exceeded. This can happen when a com
错误提示Unhandled Rejection (Error): Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.超过最大更新深度。当组件重原创 2021-07-15 17:43:45 · 1531 阅读 · 0 评论 -
React中的BUG记录——Error: Element type is invalid: expected a string (for built-in components) or a class
问题描述语法各个方面没有问题,报以下错误:Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.Check the render method of App.代码index.jsimport React from 'react';import ReactDOM from '原创 2021-07-13 14:26:06 · 3249 阅读 · 0 评论