Skip to content

Commit

Permalink
Documentation: EditorBoundary editor component (WordPress#61950)
Browse files Browse the repository at this point in the history
* Add JSDoc for ErrorBoundary editor component

* Auto-generate editor docs for ErrorBoundary component

* Refine ErrorBoundary JSDocs for editor component

* Auto-generate editor docs for ErrorBoundary component update
  • Loading branch information
colorful-tones authored and patil-vipul committed Jun 17, 2024
1 parent bcb5d8f commit 999fefd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,11 @@ Undocumented declaration.

### ErrorBoundary

Undocumented declaration.
ErrorBoundary is used to catch JavaScript errors anywhere in a child component tree, log those errors, and display a fallback UI.

It uses the lifecycle methods getDerivedStateFromError and componentDidCatch to catch errors in a child component tree.

getDerivedStateFromError is used to render a fallback UI after an error has been thrown, and componentDidCatch is used to log error information.

### FontSizePicker

Expand Down
10 changes: 10 additions & 0 deletions packages/editor/src/components/error-boundary/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,14 @@ class ErrorBoundary extends Component {
}
}

/**
* ErrorBoundary is used to catch JavaScript errors anywhere in a child component tree, log those errors, and display a fallback UI.
*
* It uses the lifecycle methods getDerivedStateFromError and componentDidCatch to catch errors in a child component tree.
*
* getDerivedStateFromError is used to render a fallback UI after an error has been thrown, and componentDidCatch is used to log error information.
*
* @class ErrorBoundary
* @augments Component
*/
export default ErrorBoundary;

0 comments on commit 999fefd

Please sign in to comment.