claus / storyblok-rich-text-react-renderer

A React renderer for Storyblok rich text content
MIT License
86 stars 16 forks source link

Add support for default resolver #1

Closed varholak-peter closed 4 years ago

varholak-peter commented 4 years ago

Right now, if there is no resolver mapped to a required node or blok type, the renderer returns null.

It would be nice to allow defaultRenderer in options. This way we can provide our own placeholder component instead of the rendering silently failing. Additional thing to consider is adding a console warning when no resolver for given node is found. This can further help with diagnostic of not yet implemented components or typos.

claus commented 4 years ago

https://github.com/claus/storyblok-rich-text-react-renderer#default-blok-resolver