But I don't understand what it is doing. The docs say it does not return anything and never throws. I tried importing "Client" that is actually a Client component to see how it behaves:
"use client";import React from "react";import { api } from "~/utils/api";export default function Client() { const apps = api.test.test.useQuery({ source: "client" }); return <div className="">{JSON.stringify(apps.data)}</div>;}
"use client";import React from "react";import { api } from "~/utils/api";export default function Client() { const apps = api.test.test.useQuery({ source: "client" }); return <div className="">{JSON.stringify(apps.data)}</div>;}
I thought it would somehow have sent the data into the ReactQuery as initialData or something, but it always fetches right when the Client component is mounted. I don't understand what prefetching does. Can someone explain
Recent Announcements
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community