Skip to content

3.4.0

Latest

Choose a tag to compare

@liaoliao666 liaoliao666 released this 28 Sep 17:08

What's Changed

✨ Features

  • Opt-in strictVariables (#78)
    Register strictVariables to make TypeScript require variables at the call site whenever the fetcher needs them:
      interface Register {
        strictVariables: true
      }                                                                          }
    
    This applies to hooks created by createQuery, createInfiniteQuery, createSuspenseQuery, createSuspenseInfiniteQuery and router, as well as to inferOptions. Hooks without variables are not affected. To keep variables optional for a fetcher that can run without them, type them as Variables | undefined.
    
    This is fully opt-in. Without the registration, nothing changes.

🐛 Fixes

  • Exclude SkipToken from infinite query queryFn types (#76)
    getOptions() and getFetchOptions() on infinite query hooks no longer include SkipToken in the queryFn type. You can now call queryFn directly or pass the options to queryClient.pe errors.

🙏 Thanks

Many thanks to Moe @moeBabazadeh for #78 and @LudvigHz for #76.