block-content-to-hyperscript icon indicating copy to clipboard operation
block-content-to-hyperscript copied to clipboard

Error while fetching the blog from sanity to my template

Open TechDevSaga opened this issue 3 years ago • 0 comments

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

TechDevSaga avatar Jun 22 '22 10:06 TechDevSaga