block-content-to-hyperscript
block-content-to-hyperscript copied to clipboard
Error while fetching the blog from sanity to my template
same error
error - Error: Unknown block type "undefined", please specify a serializer for it in the serializers.types prop
<PortableText
// Pass in block content straight from Sanity.io
content={blogs[0].content}
projectId="oeqragbg"
dataset="production"
// Optionally override marks, decorators, blocks, etc. in a flat
// structure without doing any gymnastics
serializers = {{
h1: (props) => <h1 style={{ color: "red" }} {...props} />,
li: ({ children }) => <li className="special-list-item">{children}</li>,
}}
/>
Originally posted by @Bogambo in https://github.com/sanity-io/block-content-to-hyperscript/issues/10#issuecomment-1162898100