Movatterモバイル変換


[0]ホーム

URL:


TanStack
Queryv5v5
Auto
Log In
Documentation
Framework
Version
Guides & Concepts
Framework
Version
Guides & Concepts

usePrefetchQuery

tsx
usePrefetchQuery(options)
usePrefetchQuery(options)

Options

You can pass everything tousePrefetchQuery that you can pass toqueryClient.prefetchQuery. Remember that some of them are required as below:

  • queryKey: QueryKey

    • Required
    • The query key to prefetch during render
  • queryFn: (context: QueryFunctionContext) => Promise<TData>

    • Required, but only if no default query function has been defined SeeDefault Query Function for more information.

Returns

TheusePrefetchQuery does not return anything, it should be used just to fire a prefetch during render, before a suspense boundary that wraps a component that usesuseSuspenseQuery.


    [8]ページ先頭

    ©2009-2025 Movatter.jp