The lightweight and powerful UI rendering engine without dependencies and written in TypeScript💫 (Browser, Node.js, Android, iOS, Windows, Linux, macOS)
@dark-engine/core currently doesn't have error boundaries.
Error boundaries are similar to Suspense: while Suspense "catches" promises, error boundaries catch errors. For this reason, in the React ecosystem these 2 are used together.
An error boundary would simplify useQuery usage with the suspense-only strategy, given the following changes:
Suspend when isFetching
Throw error when error && (typeof data === 'undefined'). This error can be caught by an error boundary
This behavior guarantees data is defined when the component renders. Error handling and fallback can be moved outside of the component definition.
This feature request should be marked with low priority since useQuery{strategy: 'state-only'} is also available and would remain unchanged.
This is a feature(s) request.
@dark-engine/core
currently doesn't have error boundaries. Error boundaries are similar toSuspense
: whileSuspense
"catches" promises, error boundaries catch errors. For this reason, in the React ecosystem these 2 are used together. An error boundary would simplifyuseQuery
usage with thesuspense-only
strategy, given the following changes:isFetching
error && (typeof data === 'undefined')
. This error can be caught by an error boundaryThis behavior guarantees
data
is defined when the component renders. Error handling and fallback can be moved outside of the component definition.This feature request should be marked with low priority since
useQuery
{strategy: 'state-only'}
is also available and would remain unchanged.