How to Use the React Cache Function in Next.JS 13 Server Components (Memoization) #nextjs13 #nextjs

preview_player
Показать описание


📣 Follow Coding in Flow on social media:
Рекомендации по теме
Комментарии
Автор

But how do you clear the cached function, cause suppose for a particular "id" argument an error response was cached. Now for entirety of app that ID will return error. Right ?

goelumang
Автор

I get a type error like so when I build :'(

Type error: Type 'OmitWithTag<typeof import("C:/Code/the-stack/src/app/events/page"), "default" | "metadata" | "config" | "generateStaticParams" | "revalidate" | "dynamic" | "dynamicParams" | "fetchCache" | "preferredRegion" | "runtime" | "maxDuration" | "generateMetadata", "">' does not satisfy the constraint '{ [x: string]: never; }'.
Property 'getCount' is incompatible with index signature.
Type '() => Promise<number>' is not assignable to type 'never'.

6 |
7 | // Check that the entry is a valid entry
> 8 | checkFields<Diff<{
| ^
9 | default: Function
10 | config?: {}
11 | generateStaticParams?: Function

_lorenz
Автор

How to fetch the data like fetch function using axios

nabiabdelkader