Skip to content

Commit

Permalink
fix: proper PrismicRichText serializer fallbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloashmore committed Sep 15, 2021
1 parent a44bebf commit ca1d37a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PrismicRichText.tsx
Expand Up @@ -107,7 +107,7 @@ const createDefaultSerializer = (
const img = (
<img
src={node.url}
alt={node.alt}
alt={node.alt ?? undefined}
data-copyright={node.copyright ? node.copyright : undefined}
/>
);
Expand All @@ -134,7 +134,7 @@ const createDefaultSerializer = (
data-oembed={node.oembed.embed_url}
data-oembed-type={node.oembed.type}
data-oembed-provider={node.oembed.provider_name}
dangerouslySetInnerHTML={{ __html: node.oembed.html }}
dangerouslySetInnerHTML={{ __html: node.oembed.html ?? "" }}
/>
),
hyperlink: ({ node, children }) => (
Expand Down

0 comments on commit ca1d37a

Please sign in to comment.