Closed pappitito closed 4 months ago
Hello, I don't think this is a bug. list
blocks aren't meant to have access to the list items directly, they should just render the shell of the shell of the list. The content is then displayed by the list-item
blocks.
You can see what it looks like with the default components:
{
list: (props) => {
if (props.format === 'ordered') {
return <ol>{props.children}</ol>;
}
return <ul>{props.children}</ul>;
},
'list-item': (props) => <li>{props.children}</li>,
}
What version of
@strapi/blocks-react-renderer
are you using?-npm: 9.8.1 - node 18.18.0 - "@strapi/blocks-react-renderer": "^1.0.1"
What's Wrong?
given i want to customize a block with type list and i add the return function with destructured parameter being "children" and "format". i am unable to return a node where the children are being mapped, says i cannot map children of type string.
To Reproduce
<BlocksRenderer content={content} blocks={{ list : ({format, children, })=>{ if(format === 'ordered'){ //line below returns error saying i cannot map children because it is of type string return
Expected Behaviour
i should be able to map children