Fetching data in server component
Answered
Pacific anchoveta posted this in #help-forum
Pacific anchovetaOP
Hi, everyone.
I'm trying to fetch data in my
Anyone got an idea what I'm doing wrong?
I'm trying to fetch data in my
Footer.tsx
component, which I use in my root layout file. I'm using the app dir
. However, once I set my component to async
, I get a TS error in my layout.tsx
saying that " Type 'Promise<Element>' is not assignable to type 'ReactNode'."Anyone got an idea what I'm doing wrong?
Answered by Rafael Almeida
you need to have at least TypeScript at 5.1.3 and
@types/react
at 18.2.82 Replies
you need to have at least TypeScript at 5.1.3 and
@types/react
at 18.2.8Answer
Pacific anchovetaOP
Thank you ðŸ™