-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add error boundary to experimental navigation screen #23679
Conversation
Size Change: +8.41 kB (0%) Total Size: 1.14 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to check that onError
isn't undefined, but otherwise this is good. Approving in advance so that I don't hold you up.
Agree that a component which edit-post
, edit-navigation
and edit-widgets
shares would be good. It could contain both Attempt recovery and Copy error.
} | ||
|
||
reboot() { | ||
this.props.onError(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined
.
this.props.onError(); | |
if ( this.props.onError ) { | |
this.props.onError(); | |
} |
Description
Solves #23417 by adding an error boundary to inform the user about any problems (instead of displaying the blank page).
There is a similar component in the editor package, but it's editor-specific enough to justify creating a "private" component for the purposes of edit-navigation package. Bringing a configurable ErrorBoundary component to
@wordpress/components
is definitely worth discussing as there are more places that could benefit from it (e.g. the widgets screen).How has this been tested?
Types of changes
New feature (non-breaking change which adds functionality)
Checklist: