InterviewSolution
Saved Bookmarks
| 1. |
What are keys in React? |
|
Answer» A key is a special string attribute that needs to be included when using lists of elements. Example of a list using key - const ids = [1,2,3,4,5];const listElements = ids.map((id)=>{return(<li key={id.toString()}> {id}</li>)})Importance of keys -
|
|