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

feat: add <PrismicRichText /> #96

Closed dayhaysoos closed 2 years ago

dayhaysoos commented 2 years ago

Types of changes

Description

PrismicRichText is an essential tool for using Prismic. This PR is a React version of that implementation.

Checklist:

babyducks

angeloashmore commented 2 years ago

The updates are looking good! I added a comment above about the in-code documentation with a lengthy example.

dayhaysoos commented 2 years ago

Question: Does the defaultComponentSerializer need to have comments on it, since it's not really something users would be calling directly?

angeloashmore commented 2 years ago

Question: Does the defaultComponentSerializer need to have comments on it, since it's not really something users would be calling directly?

It doesn't need to be deeply documented since it is an internal function. It would still be good to document what it's doing for future developers to understand its purpose.

Personally, I would just add a sentence or two describing what it's doing (using default HTML elements for block types) and what it's for (the fallback serializer if one is not provided).