Next.js Discord

Discord Forum

Handling Block Content Type from Sanity in Next.js with TypeScript

Unanswered
Braconid wasp posted this in #help-forum
Open in Discord
Braconid waspOP
Hi, I want to fetch a post from Sanity to my Next.js app, but TypeScript types are required. Is the approach for handling the block content field correct?

10 Replies

u dont need to use Array#Unknown Channel tho, u can just use []
Braconid waspOP
@gin Is there any potential unexpected behavior when using PortableText from @portabletext/react?
is there a better approach to handling rich text in my Next.js app ?
uhm
i would say trial and error
try out and see if it works
i dont know what portabletext/react is
Braconid waspOP
@gin thank u ❤
np :)