Facing some compatibility Error with PageProps and SearchParamProps #72968
-
SummaryError - This is my page.ts file - type TEntry = typeof import('../../../../../../../app/(root)/events/[id]/update/page.js') type SegmentParams = T extends Record<string, any> // Check that the entry is a valid entry metadata?: any }, TEntry, ''>>() // Check the prop type of the entry function // Check the arguments and return type of the generateMetadata function // Check the arguments and return type of the generateViewport function // Check the arguments and return type of the generateStaticParams function export interface PageProps { } params?: Promise // ============= // If T is unknown or any, it will be an empty {} type. Otherwise, it will be the same as Omit<T, keyof Base>. type FirstArg = T extends (...args: [infer T, any]) => any ? unknown extends T ? any : T : never function checkFields<_ extends { [k in keyof any]: never }>() {} // https://github.com/sindresorhus/type-fest this is my page.tsx file - import CheckoutButton from '@/components/shared/CheckoutButton'; const EventDetails = async ({ params: { id }, searchParams }: SearchParamProps) => { const relatedEvents = await getRelatedEventsByCategory({ return (
) export default EventDetails I tried to change and wrap in promise as well but it is not working and my code is failing while deploying the application , kindly help. Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Do this: const EventDetails = async ({
params,
searchParams,
}: {
params: Promise<{ id: string }>
searchParams: Promise<{ [key: string]: string | string[] | undefined }>
}) => { Make sure that works, and then update your own |
Beta Was this translation helpful? Give feedback.
-
Thank you so much. It worked.
…On Wed, 20 Nov 2024 at 00:15, Joseph ***@***.***> wrote:
Do this:
const EventDetails = async ({
params,
searchParams,}: {
params: Promise<{ id: string }>
searchParams: Promise<{ [key: string]: string | string[] | undefined }>}) => {
Make sure that works, and then update your own SearchParamProps
definition.
—
Reply to this email directly, view it on GitHub
<#72968 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXFLVP2XCOSJBQBJYQ7ATJT2BOBLXAVCNFSM6AAAAABSCZBTD2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCMZQHE4TOOI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Nice. Please don't forget to mark as answered!