1. Home
  2. Computer Science MCQs
  3. REACT
  4. Why does React need a key prop when rendering a list of…

Added 2 Nov 2026

Why does React need a key prop when rendering a list of elements?

  1. To identify items so updates are efficient Correct answer
  2. To make each list item clickable by default
  3. To set the order in which items are styled
  4. To store the item's data in local storage

Correct answer

A. To identify items so updates are efficient

18 views

MCQSEXAM

Explanation

Keys let React's reconciliation match items between renders, so it can reorder, add or remove only what changed. Stable IDs work best. Array indexes can cause bugs when the list order changes.

Reference

Asked in: React Interviews, Frontend Developer Tests

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More REACT MCQs

Practise all REACT MCQs

Similar MCQs