sanity-io / block-content-to-react

Deprecated in favor of @portabletext/react
https://github.com/portabletext/react-portabletext
MIT License
161 stars 25 forks source link

Change default value of `renderContainerOnSingleChild` to `true` #30

Closed barbogast closed 1 year ago

barbogast commented 4 years ago

I was very confused / surprised by the renderer not rendering my configured container all of a sudden. It took me a while to realise that the reason was that the block content only contained one element. I also nearly missed the option renderContainerOnSingleChild.

To have differing element hierarchies between content with one element and with multiple elements seems to be a special requirement rather then a good default. I suggest therefore to change the default of renderContainerOnSingleChild to true.

It would be a breaking change, though :-/

Thanks for considering :-)

rexxars commented 1 year ago

Closing this, as the new @portabletext/react library is the successor to this module. Please see https://github.com/portabletext/react-portabletext