Skip to content

Commit 9fd809c

Browse files
author
我和胖虎五五开
committed
备用改降级
1 parent fb74d1d commit 9fd809c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

content/docs/reference-react-component.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -343,13 +343,13 @@ class ErrorBoundary extends React.Component {
343343
}
344344
345345
static getDerivedStateFromError(error) {
346-
// 更新 state 使下一次渲染可以显示后备UI
346+
// 更新 state 使下一次渲染可以显降级UI
347347
return { hasError: true };
348348
}
349349
350350
render() {
351351
if (this.state.hasError) {
352-
// 你可以渲染任何自定义的后备UI
352+
// 你可以渲染任何自定义的降级UI
353353
return <h1>Something went wrong.</h1>;
354354
}
355355
@@ -389,7 +389,7 @@ class ErrorBoundary extends React.Component {
389389
}
390390
391391
static getDerivedStateFromError(error) {
392-
// 更新 state 使下一次渲染可以显示后备UI
392+
// 更新 state 使下一次渲染可以显示降级UI
393393
return { hasError: true };
394394
}
395395
@@ -404,7 +404,7 @@ class ErrorBoundary extends React.Component {
404404
405405
render() {
406406
if (this.state.hasError) {
407-
// 你可以渲染任何自定义的后备UI
407+
// 你可以渲染任何自定义的降级UI
408408
return <h1>Something went wrong.</h1>;
409409
}
410410

0 commit comments

Comments
 (0)