700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > React will try to recreate this component tree from scratch using the error boundary you provided

React will try to recreate this component tree from scratch using the error boundary you provided

时间:2018-08-24 01:19:11

相关推荐

React will try to recreate this component tree from scratch using the error boundary you provided

使用ntd.pro提供的protable时,碰到个问题。其实是无意间碰到的,我只是修改了一个表的参数,导致整个表格用不了,错误信息指向了某个函数未定义或者不是一个函数,正常情况下是不会出现这种情况的,那多半是我们在使用的时候传递的参数不匹配导致的。

第一个错误感觉无从下手,然后我饶有兴趣的看了第二个错误,"The above error occurred in the <Table> component',既然上面的错误是下面这个导致的,那么看一下下个错误就知道了。好像也是一堆看不懂的东西,但是至少出现了我所定义的模块,而不全部是官方API的错误提示。

看最后一句话,"React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary."

意思大概是,react将尝试重新创建这个组件树,使用你提供的错误边界。说白了就是你传给table组件的数据出现了问题,导致组件table无法去渲染/创建组件。

到这里就明显的,估计是list的数据格式不对导致了这种问题。果然发现,后台将数据格式改了,改成了嵌套,导致我的list不是一个集合,而是一个对象,table无法去识别这个东西,导致无法渲染。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。