What is the standard way to fetch on RSC

create t3 app using App Router uses prefetch and hydrate client by default but why not use the caller instead? What is the benefit of prefetch?
export default async function Home(){
void api.post.getLatest.prefetch();
return <HydrateClient>
...
<View/>
...
</HydrateClient>
}
export default async function Home(){
void api.post.getLatest.prefetch();
return <HydrateClient>
...
<View/>
...
</HydrateClient>
}
export default async function Home(){
const posts = await caller.post.getLatest();
return <>
...
<View posts={posts} />
...
</>
}
export default async function Home(){
const posts = await caller.post.getLatest();
return <>
...
<View posts={posts} />
...
</>
}
Solution:
No need to pass props down and handle errors etc.
Jump to solution
1 Reply
Solution
Omar-7ioo
Omar-7ioo3mo ago
No need to pass props down and handle errors etc.
Want results from more Discord servers?
Add your server