JSFiddle - React, Tailwind, and code Playground
HTML
<div id="root" class="container">
</div>
CSS
.container {
height: 300px;
width: 80%;
border: 1px solid black;
}
.item {
width: 50px;
height: 50px;
background-color: #d3d3d8;
margin: 10px;
}
JavaScript
function getContent(offset, num) {
let arr = [];
for (var i = offset; i < offset + num; i++) {
arr.push(i);
}
return new Promise((resolve) => {
setTimeout(() => {
resolve(arr);
}, Math.random() * 2000);
});
}