Here is my code -
return (
<RichText
tagName="div"
value={ author_name }
placeholder={ __( "Author Name" ) }
className='uagb-tm__author-name'
onChange={ ( value ) => {
var new_content = { "description" : data_copy[index_value]["description"], "name":value, "company" : data_copy[index_value]["company"], "image" : data_copy[index_value]["image"] }
data_copy[index_value] = new_content
setAttributes( { "test_block": data_copy } )
} }
onMerge = { props.mergeBlocks }
unstableOnSplit = {
props.insertBlocksAfter ?
( before, after, ...blocks ) => {
setAttributes( { content: before } )
props.insertBlocksAfter( [
...blocks,
createBlock( "core/paragraph", { content: after } ),
] )
} :
undefined
}
onRemove={ () => props.onReplace( [] ) }
/>
)