You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Accepting nullish values in <PrismicRichText> and <PrismicText> could lead to a better developer experience. When working with API responses, values passed to those components will never be null or undefined. The API should always return at least [] when the field is left empty.
When a document is still being fetched, however, the value passed to the components may not exist yet.
We can detect this within the components and appropriately return null or undefined. We can also opt out of doing any additional processing, ultimately leading to less work being done.
Accepting nullish values in
<PrismicRichText>
and<PrismicText>
could lead to a better developer experience. When working with API responses, values passed to those components will never benull
orundefined
. The API should always return at least[]
when the field is left empty.When a document is still being fetched, however, the value passed to the components may not exist yet.
We can detect this within the components and appropriately return
null
orundefined
. We can also opt out of doing any additional processing, ultimately leading to less work being done.Related: prismicio/prismic-richtext#50
The text was updated successfully, but these errors were encountered: