diff --git a/docs/start/framework/react/guide/authentication.md b/docs/start/framework/react/guide/authentication.md index 4bee76cff70..5abb4789509 100644 --- a/docs/start/framework/react/guide/authentication.md +++ b/docs/start/framework/react/guide/authentication.md @@ -143,8 +143,10 @@ type AuthContextType = { const AuthContext = createContext(undefined) export function AuthProvider({ children }: { children: ReactNode }) { - const { data: user, isLoading, refetch } = useServerFn(getCurrentUserFn) - + const { data: user, isLoading, refetch } = useQuery({ + queryKey: ["auth"], + queryFn: useServerFn(getCurrentUserFn), + }) return ( {children}