fix(next): unable to pass custom view client components (#6513)

This commit is contained in:
Alessio Gravili
2024-05-27 22:48:41 -04:00
committed by GitHub
parent 38e5adc462
commit eff5129a5f

View File

@@ -2,6 +2,7 @@ import type { I18n } from '@payloadcms/translations'
import type { Metadata } from 'next' import type { Metadata } from 'next'
import type { SanitizedConfig } from 'payload/types' import type { SanitizedConfig } from 'payload/types'
import { WithServerSideProps } from '@payloadcms/ui/elements/WithServerSideProps'
import { DefaultTemplate } from '@payloadcms/ui/templates/Default' import { DefaultTemplate } from '@payloadcms/ui/templates/Default'
import { MinimalTemplate } from '@payloadcms/ui/templates/Minimal' import { MinimalTemplate } from '@payloadcms/ui/templates/Minimal'
import { notFound, redirect } from 'next/navigation.js' import { notFound, redirect } from 'next/navigation.js'
@@ -82,7 +83,16 @@ export const RootPage = async ({
} }
const RenderedView = ( const RenderedView = (
<DefaultView initPageResult={initPageResult} params={params} searchParams={searchParams} /> <WithServerSideProps
Component={DefaultView}
serverOnlyProps={
{
initPageResult,
params,
searchParams,
} as any
}
/>
) )
return ( return (