I am trying to display multiple (approximately 10) images in a modal by looping through the each of them. The modal opens after clicking on the link present in a table cell, but nothing shows in the modal.
When I display only 1 image, then it gets displayed in modal. I am using React.js for the first time. Please help me with the solution to my problem. Thanks in advance.
}, {
Header: 'Screenshot',
accessor: 'screenshot',
maxWidth: 100,
Cell: row => {
if (row.original.screenshot)
var array = [];
for (var i = 0; i < row.original.screenshot.length; i++) {
array.push = <img src={"data:image/png;base64," + row.original.screenshot[i]} />
}
var Image = array.join('');
return <a onClick={() => {
this.setState({
screenShotModalOpen: true,
screenShotImage:
<div>
{Image}
</div>
})
href={'javascript:void(0)'}>View</a>
}}
},
}],
}]