Q. What is the role of the `key` prop in React?

  • (A) To pass data to components
  • (B) To keep elements stable during updates
  • (C) To identify the component
  • (D) To trigger a rerender
πŸ’¬ Discuss
βœ… Correct Answer: (B) To keep elements stable during updates
Explanation: Keys help React identify which items have changed, are added, or are removed.
Explanation by: Mr. Dubey
Keys help React identify which items have changed, are added, or are removed.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
71
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
96%
Success Rate