如果报错没有没有被catch,将会引起整个React组件树的unmounting

解决方法:在生命周期中增加componentDidCatch

https://reactjs.org/blog/2017/07/26/error-handling-in-react-16.html

posted on 2018-05-18 15:23  翻页工  阅读(534)  评论(0编辑  收藏  举报