From ecf982dfd6c2c7a6caf9446fcfae7453e24fb175 Mon Sep 17 00:00:00 2001 From: minami-minami Date: Wed, 9 Nov 2022 23:42:47 +0900 Subject: [PATCH] docs(guides/prefetching): prefer object syntax --- docs/guides/prefetching.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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, + }) } ```