Skip to content

0.70.1

Choose a tag to compare

@nstfkc nstfkc released this 30 Sep 07:28
· 345 commits to main since this release

trigger is typed Promise<T | undefined>, and mutate ignores an event. (#623, #630) No runtime change.

  • useMutation / usePost / usePut / usePatch / useDelete and useUpload: trigger(...) already resolved undefined when a request failed, was cancelled, or was replaced by a newer trigger, but was typed Promise<T>. It is now typed Promise<T | undefined>. Under strictNullChecks, reading the result without a check is now a type error; the typed error is still delivered to onError / error.
  • useQuery's mutate: a DOM or React event passed to it (e.g. onClick={mutate}) is ignored, and the call refetches like mutate(). Before, it threw.

See "What trigger resolves to" in the data-fetching docs.