7.5.2.62. ErrorBoundaryFallbackPage


创建全页 ErrorBoundaryFallbackPage 组件以显示 "Oh no!Something went wrong." 消息与堆栈跟踪和其他有帮助的调试信息一起。这与组件一起使用。

Example

//in ErrorBoundary component
 return (
   if (this.state.hasError) {
     return <ErrorBoundaryFallbackPage errorMessage={errorString} componentStack={componentStackString}
      stack={stackTraceString} title={errorString}/>;
   }

   return this.props.children;
)

Expand
参数名称描述

errorMessage

错误消息的文本描述

componentStack

异常的组件追踪

queue

异常的堆栈追踪

title

将标题显示为错误边界页面的标头

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部