opendevs
opendevs logo
CoursesInterviewsBlogs

Lists and Keys

A list is a collection of ordered or unordered items. Creating a list is a super common technique for displaying a list of data. In React, you can use the map() function of arrays to iterate over a list and render the data.
Component Lifecycle Phases
Loading video...

Rendering a List (in Hindi)

Concepts

    1

    Rendering a List (in Hindi)
    Rendering a List (in Hindi)

    2

    Keys in List (in Hindi)
    Keys in List (in Hindi)

    3

    Do Not Use Array Index as Keys(in Hindi)
    Do Not Use Array Index as Keys(in Hindi)
Watch the full video to earn  3  DevCoin image

Quizzes


1

We should use keys while rendering lists in React because

Question 1 of 5
1  DevCoin image   per question
2

Which of these statements are true about keys? Select all that apply.

Question 1 of 5
1  DevCoin image   per question
3

Key prop on an element is passed to its children.

Question 1 of 5
1  DevCoin image   per question
4

If you get a warning like this in console, what are some of the possible reasons? Select all that apply.

Warning: Each child in a list should have a unique "key" prop
Question 1 of 5
1  DevCoin image   per question
5

Keys don't have to be globally unique. We can use the same keys when we produce two different arrays.

Question 1 of 5
1  DevCoin image   per question

Coding Questions


Using Keys in Lists

easy

1  DevCoin image
Using Keys in Fragments

easy

1  DevCoin image
Render Two Lists

medium

2  DevCoin image
opendevs logo
CoursesFAQsContact UsPrivacy PolicyTerms Of Service
Copyright © 2023 opendevs
Learn ● Develop ● Ace
All illustrations by Storyset