// 这里是需要高亮的代码
import React, { Component } from 'react'
componentDidCatch (error, errorInfo) {
this.setState({
error,
errorInfo,
hasError: true,
})
}
标签:hasError,高亮,代码,react,error,errorInfo
From: https://www.cnblogs.com/coldwindblow/p/16904845.html