You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
{ children.map((item, index)=>(
{item}
))
}
}
}
}}
/>
Expected Behaviour
i should be able to map children
The text was updated successfully, but these errors were encountered:
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.
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
The text was updated successfully, but these errors were encountered: