sanity-io / block-content-to-hyperscript

Function for transforming Sanity block content to HyperScript
MIT License
17 stars 8 forks source link

Error while fetching the blog from sanity to my template #26

Open TechDevSaga opened 2 years ago

TechDevSaga commented 2 years ago

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