I have a component for displaying a list, and this component is rendered from a parent component. I am currently generating the contents of this list using a for loop. Like -
let content = []
for (let i = 0; i < list.length; i++) {
content.push(
<div>
<p> list[i].something </p>
<p> list[i].somethingElse </p>
</div>
)
}
return content;
Now whenever a new object is added to this list, all the previous objects of the list, and the newly added object get rendered. This becomes extremely slow when the list contains around 1000 objects.
Is there a way by which only the new added can be added and rendered, without re-rendering all the previous entries of the list again?