diff --git a/docs/guides/prefetching.md b/docs/guides/prefetching.md index 1d8d443438..390c048635 100644 --- a/docs/guides/prefetching.md +++ b/docs/guides/prefetching.md @@ -8,7 +8,10 @@ If you're lucky enough, you may know enough about what your users will do to be ```tsx const prefetchTodos = async () => { // The results of this query will be cached like a normal query - await queryClient.prefetchQuery(['todos'], fetchTodos) + await queryClient.prefetchQuery({ + queryKey: ['todos'], + queryFn: fetchTodos, + }) } ```