Add usePrefetchQuery #5862
Merged
Merged
Conversation
|
@DogPawHat is attempting to deploy a commit to the trpc Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
b5e2264 to
c152a08
Compare
c5da8d2 to
8c57ad1
Compare
juliusmarminge
approved these changes
Aug 27, 2024
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Changes
Adding
usePrefetchQuery,usePrefetchInfiniteQueryfrom Tanstack Query into@trpc/react-queryThese 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
Prefetchingsub-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 withusePrefetchQuery> regular fetch-as-you-render)✅ Checklist