How to add a hr Component to `blockContent` Schema

2 replies
Last updated: Jun 22, 2020
Hey folks, I'd like to add an hr component to my
blockContent
schema. I've been combing through the docs, but I can't figure out a good solution. Any ideas?
Jun 22, 2020, 7:52 PM
We should perhaps add it to docs, but this is my best suggestion at the moment, because there can be several types of “breaks” (which a hr is an expression of)

https://codesandbox.io/s/portable-text-serializer-for-breaks-e4v35?file=/src/Page.js:2800-2813
Jun 22, 2020, 8:12 PM
Wicked. Thanks for the example
user Y
🙂
Jun 22, 2020, 8:16 PM

Sanity.io – build remarkable experiences at scale

Sanity is a customizable solution that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Categorized in