dify/web/app/components/plugins/marketplace/hydration-server.tsx
Coding On Star cb6c04637b
feat(web): add marketplace creator profiles and homepage redesign (#41538)
Co-authored-by: zxhlyh <jasonapring2015@outlook.com>
Co-authored-by: fatelei <fatelei@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: CodingOnStar <hanxujiang@dify.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: 姜涵煦 <hanxujiang@jianghanxudeMacBook-Pro-2.local>
Co-authored-by: L1nSn0w <l1nsn0w@qq.com>
Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
2026-09-04 08:09:45 +00:00

21 lines
707 B
TypeScript

import type { DehydratedState } from '@tanstack/react-query'
import type { SearchParams } from 'nuqs/server'
import { HydrationBoundary } from '@tanstack/react-query'
import { prefetchMarketplaceDehydratedState } from './prefetch-marketplace-dehydrated-state'
export async function HydrateQueryClient({
searchParams,
prefetchedState,
children,
}: {
searchParams: Promise<SearchParams> | undefined
prefetchedState?: DehydratedState
children: React.ReactNode
}) {
const dehydratedState =
prefetchedState === undefined
? await prefetchMarketplaceDehydratedState(searchParams)
: prefetchedState
return <HydrationBoundary state={dehydratedState}>{children}</HydrationBoundary>
}