Skip to content

Add usePrefetchQuery #5862

Merged
juliusmarminge merged 24 commits into
trpc:nextfrom
DogPawHat:add-use-prefetch-query
Aug 27, 2024
Merged

Add usePrefetchQuery #5862
juliusmarminge merged 24 commits into
trpc:nextfrom
DogPawHat:add-use-prefetch-query

Conversation

@DogPawHat

@DogPawHat DogPawHat commented Jul 5, 2024

Copy link
Copy Markdown
Contributor

🎯 Changes

Adding usePrefetchQuery, usePrefetchInfiniteQuery from Tanstack Query into @trpc/react-query

These hooks are mostly useful for doing component level prefetching near the top of a component tree above a Suspense boundary. I've added the documentation in a Prefetching sub-section under the Suspense docs, with a caveat that prefetching and render-as-you-fetch is dependent on what framework and router you are using (e.g. prefetching in server-side (getServerSideProps) > prefetching in Tanstack/React Router loaders > component prefetching with usePrefetchQuery > regular fetch-as-you-render)

✅ Checklist

  • I have followed the steps listed in the Contributing guide.
  • If necessary, I have added documentation related to the changes made.
  • I have added or updated the tests related to the changes made.

@vercel

vercel Bot commented Jul 5, 2024

Copy link
Copy Markdown

@DogPawHat is attempting to deploy a commit to the trpc Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Jul 5, 2024

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 27, 2024 0:51am

Comment thread packages/react-query/src/createTRPCReact.tsx Outdated
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants