Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept nullish Rich Text values in PrismicRichText and PrismicText #99

Closed
angeloashmore opened this issue Oct 25, 2021 · 1 comment
Closed
Labels
enhancement New feature or request v2 Getting addressed or related to version 2 of the kit

Comments

@angeloashmore
Copy link
Member

angeloashmore commented Oct 25, 2021

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.

Related: prismicio/prismic-richtext#50

@angeloashmore angeloashmore added enhancement New feature or request v2 Getting addressed or related to version 2 of the kit labels Oct 25, 2021
@angeloashmore
Copy link
Member Author

Included in v2.0.0-beta.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v2 Getting addressed or related to version 2 of the kit
Projects
None yet
Development

No branches or pull requests

1 participant