Skip to content
Source
Sign inSign up
TanStack/query

fix: no hydration when new promise comes in #8383

Mergedjuliusmarmingemerged 35 commits intomain fromrefs/pull/8383/headmerged by TkDodo View on GitHub

Showing 11 changed files with 19 additions and 0 deletions (loading 8).

x
0 of 11 viewed, 11 left
8 additions and 0 deletionsdocs/framework/react/guides/advanced-ssr.mdModified
View file
@@ -392,6 +392,14 @@
shouldDehydrateQuery: (query) =>
defaultShouldDehydrateQuery(query) ||
query.state.status === 'pending',
+ shouldRedactErrors: (error) => {
+ // We should not catch Next.js server errors
+ // as that's how Next.js detects dynamic pages
+ // so we cannot redact them.
+ // Next.js also automatically redacts errors for us
+ // with better digests.
+ return false
+ },
6 additions and 0 deletionsdocs/framework/react/reference/hydration.mdModified
View file
@@ -38,6 +38,12 @@
- Defaults to only including successful queries
- If you would like to extend the function while retaining the default behavior, import and execute `defaultShouldDehydrateQuery` as part of the return statement
- `serializeData?: (data: any) => any` A function to transform (serialize) data during dehydration.
+ - `shouldRedactErrors?: (error: unknown) => boolean`