Use only map not for loop to display the data.
const items = ["Item 1", "Item 2", "Item 3"];
const renderedItems = items.map((item, index) => (
<div key={index}>{item}</div>
));
© www.thecoderjob.com. All Rights Reserved. Designed by HTML Codex