
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeLooking at your code, I can see the issue! You're using the old deprecated @sanity/block-content-to-react package API with serializers and content props, but it looks like you've upgraded to the newer @portabletext/react package which has a different API.
The @sanity/block-content-to-react package was deprecated in favor of @portabletext/react, and the new package uses different prop names:
content → valueserializers → componentsdataset and projectId propsHere's how to update your code:
import { PortableText } from '@portabletext/react'
<PortableText
className='mt-10'
value={post.body} // Changed from 'content' to 'value'
components={{ // Changed from 'serializers' to 'components'
block: {
h1: ({children}) => (
<h1 className='text-2xl font-bold my-5'>{children}</h1>
),
h2: ({children}) => (
<h2 className='text-xl font-bold my-5'>{children}</h2>
),
},
list: {
bullet: ({children}) => <ul className='ml-4'>{children}</ul>,
},
listItem: {
bullet: ({children}) => <li className='list-disc'>{children}</li>,
},
marks: {
link: ({value, children}) => (
<a className='text-blue-500 hover:underline' href={value?.href}>
{children}
</a>
),
},
}}
/>Key changes to note:
children instead of being passed the entire props objectblock, list, listItem, and marks categoriesmarks.link and receive a value prop with the link dataMake sure you have @portabletext/react installed:
npm install @portabletext/reactYou can find more details in the official Sanity documentation on presenting Portable Text, which covers the migration from the old package to the new one.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store