Skip to content

v1.0.14

Choose a tag to compare

@debabin debabin released this 21 Aug 07:04
· 17 commits to main since this release

Rework useImage

This release rewrites useImage as a standalone hook and changes the initial loading state of useQuery under SSR.

Changes

  • useImage — reworked from a wrapper over useQuery into a standalone hook built on useEffect/useState. It creates an Image, applies the provided options, listens for load/error, cleans up listeners on unmount, and separately handles already-completed images via image.complete/naturalWidth. The API changes accordingly: instead of data/refetch/abort/isFetching/isRefetching, the hook now returns value/error/isLoading/isError/isSuccess.

Fixes

  • useQuery — the initial isLoading/isFetching state is no longer tied to the presence of window; it now derives from enabled, so both start as true under SSR.