🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: React Basics: all 10 questions

Quiz: React Basics · Question 5 of 10

Why should list keys be stable ids rather than array indexes?

Why should list keys be stable ids rather than array indexes?

  1. A.Indexes are not allowed
  2. B.Indexes change when items are added, removed or reordered, confusing React
  3. C.Ids make the app faster to download
  4. D.Keys are optional anyway
Answer & explanation

Correct answer: Indexes change when items are added, removed or reordered, confusing React

Stable keys let React match items correctly between renders.

Can you get the rest right without peeking?

Take the timed Quiz: React Basics quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →