You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the UIs I'm building I often don't just want to show an error instead of the previous content when a failure occurs. I instead want to do things like show an inline error message inside the content, show a retry button, ...
I find that the combination of createResource and <ErrorBoundary> often makes this extremely cumbersome or impossible, especially with nested state, or when mutating data previously obtained via createResource(), processing the error somehow, ...
You can make sure to always catch errors in the loader for the resource, but now the resource data needs to represent the error state, which is redundant because the resource already stores this information.
It would be great to get something like a createFallibleResource() (or a {propagateErrors: false} option) which doesn't propagate errors upwards.
I quickly put together a little wrapper that does this.
It's pretty hacky though...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In the UIs I'm building I often don't just want to show an error instead of the previous content when a failure occurs. I instead want to do things like show an inline error message inside the content, show a retry button, ...
I find that the combination of
createResource
and<ErrorBoundary>
often makes this extremely cumbersome or impossible, especially with nested state, or when mutating data previously obtained viacreateResource()
, processing the error somehow, ...You can make sure to always catch errors in the loader for the resource, but now the resource data needs to represent the error state, which is redundant because the resource already stores this information.
It would be great to get something like a
createFallibleResource()
(or a{propagateErrors: false}
option) which doesn't propagate errors upwards.I quickly put together a little wrapper that does this.
It's pretty hacky though...
Any chance to get something like this upstream?
Beta Was this translation helpful? Give feedback.
All reactions