prismicio / prismic-react

React components and hooks to fetch and present Prismic content
https://prismic.io/docs/technologies/homepage-reactjs
Apache License 2.0
154 stars 40 forks source link

fix: detect empty Rich Text fields using `@prismicio/helpers`'s `isFilled.richText()` #130

Closed angeloashmore closed 2 years ago

angeloashmore commented 2 years ago

Types of changes

Description

This PR correctly handles all types of empty Rich Text fields when using <PrismicRichText> and <PrismicText>. It uses @prismicio/helpers's isFilled.richText() helper internally.

This PR was done specifically to fix an unhandled case where a Rich Text field could contain a single empty paragraph block. This is treated as empty when using isFilled.richText(), but it was not handled properly in @prismicio/react before this PR.

Checklist:

🐕‍🦺

github-actions[bot] commented 2 years ago

size-limit report 📦

Path Size
dist/index.js 4.38 KB (+6.74% 🔺)
dist/index.cjs 6.27 KB (+0.46% 🔺)