I am new with React and cannot write correct code for the situation. Let me explain in the code
class Test extends React.Component {
render() {
// IndexedDB indexes
const ids = ['id1', 'id2', 'id3'];
// fetch data and build a list
const files = ids.map((id) =>
localforage.getItem(id).then((entry) =>
<li key={entry.id}><img src={entry.data} /></li>
);
);
return (
<ul>{files}</ul>
)
}
}
What is the correct way to asynchronous load all data and display it?