blocks-react-renderer
blocks-react-renderer copied to clipboard
feat: add plainText to headings
What does it do?
It allows to have access to the plainText of a heading block.
Why is it needed?
Sometimes you might want to have access to the plain text of a heading to be able to add an attribute to it, like for creating anchors to point to them.
How to test it?
In a frontend app, use the renderer (link it via yarn), and pass a custom component for heading that uses the plainText prop
Related issue(s)/PR(s)
Inspired by https://github.com/strapi/blocks-react-renderer/pull/17
I'm gonna push a fix for that today ! Was thinking if it wouldn't be interesting to also pass the raw object (from the strapi response) to every block types. For now, we only have access to the React.Node
no feedback on this @remidej ? any chance this get merged ? :)