Closed kb1995 closed 2 years ago
Hey @kb1995, thanks for pointing this out. This is how the component was intended to work but wasn't written correctly.
@prismicio/react@v2.0.1
fixes this.
You can now provide a components
prop to <PrismicRichText>
that will fall back to components defined in <PrismicProvider>
and then to the default components.
If this isn't working correctly after updating please let me know and I'll take another look. Thanks!
Hey,
Just wanted to share some food for thought. Currently I have an HTML serializer which updates links, embeds and specific labels.
In one of my custom types, I want to add a special rule for Heading 2 which is not present in other custom types. So I will add a special HTML serializer which updates my Heading 2. However, then I need to copy my other rules for links, embeds, etc into that new HTML serializer.
It would be nice if instead just overwrite the heading 2 and fallback to the others objects.
This means that if I update the links object, it would overwrite the default links object in the default HTML serializer. However, if I add a Heading 2, it would still use default HTML serializer + my new specific Heading 2
I might have explained it in a horrible way, but hopefully it makes some kind of sense :D