Mid
From PDF
React
React.js
How can you optimize rendering lists in React?
Short answer: Rendering large lists can cause performance issues if each item re-renders unnecessarily. Here are some strategies:
Real-world example (ShopNest)
When rendering cart lines, use a stable key={item.id}—not the array index—so React updates the right row after delete.
Say this in the interview
- Define — one clear sentence (the short answer above).
- Example — relate it to a project like ShopNest or your real work.
- Trade-off — when you would not use it.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png