v6.21.0
v6.21.0 (Minor Release)
Status: Released
This is a new minor release of the @alextheman/components package. It introduces new features and other backwards-compatible changes that should require little to no refactoring. Please read the description of changes below.
Description of Changes
- Export the
useQueryBoundaryhook- I can't believe all this time it was never exported...
- This can be used to access the context value provided by the
QueryBoundaryProvidercomponent (or theQueryBoundary.Contextusing the compound component pattern), which can often be helpful in cases where you're creating your ownQueryBoundarycomponent that listens out for the same query state. - It is different to
createQueryBoundarybecause that function solely creates the compoundQueryBoundarynamespace, whereas thisuseQueryBoundaryhook gives you direct access to theisLoading,error, anddatastates.
- Fix check ordering in
QueryBoundaryData- This re-orders the checks so that we check for an error first, and if there is an error, we return
nullout ofQueryBoundaryData(so it can be handled byQueryBoundaryError). - Previously, if loading and error state existed at the same time, the loading component would show at the same time as the error component, which was not ideal. With this change, the error component will return early, ensuring that the loading component (along with the data) does not show if there is an error.
- This re-orders the checks so that we check for an error first, and if there is an error, we return