Default ErrorBoundary and Hook? #81
chantastic
started this conversation in
Q&A
Replies: 1 comment 5 replies
-
Just to clarify, is this more a...
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A couple days ago, @drcmda and I were having a discussion on Twitter over a minimal suspense-fetch example using only React-supplied libraries.
ErrorBoundary
and the third-party library use-error-boundary was came up as a point of frustration.The current state of
ErrorBoundary
is extremely flexible — geared toward adaptability in real-world conditions. But I wonder if there is a way to provide a flexible convenience for newcomers as well.My goal here is not so much to suggest a particular API but raise an area where there is a lot of newcomer friction.
While this might not hit all of the buttons, I think an experience like this could provide a very clean on-boarding experience:
Problems
Providing a basic implementation definitely runs the risk of being interpreted as a default implementation. And, in an effort to make the component more flexible, there would be a number of unsightly design decisions that would have to be made:
Benefits
The benefit of providing a basic implementation is that newcomers get a quick path-to-first-fetch and can move quickly onto understanding the relationship between error boundaries and Suspense boundaries, and how to coordinate them with data.
Beta Was this translation helpful? Give feedback.
All reactions