Fetching data in server component
Answered
Pacific anchoveta posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/1.png)
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?
![Image](https://cdn.discordapp.com/attachments/1135627469957906563/1135627470331187342/Screenshot_2023-07-31_at_19.32.53.png)
Answered by Rafael Almeida
you need to have at least TypeScript at 5.1.3 and
@types/react
at 18.2.82 Replies
![Avatar](https://cdn.discordapp.com/guilds/752553802359505017/users/258390283127881728/avatars/6d84d27ad734d86c3c3d7f004660bded.webp?size=256)
Rafael Almeida
you need to have at least TypeScript at 5.1.3 and
@types/react
at 18.2.8Answer
![Avatar](https://cdn.discordapp.com/embed/avatars/1.png)
Pacific anchovetaOP
Thank you ðŸ™