You are given a task to optimize a large list rendering in a React application. Which concept would you apply to ensure only changed items are re-rendered?

  • Index-based rendering
  • Key prop
  • Memoization
  • Virtual DOM
To optimize large list rendering in React and ensure that only changed items are re-rendered, you should use the key prop. The key prop uniquely identifies each element in the list, allowing React to efficiently update and re-render only the necessary items when the list changes.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *