Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Render a Movie List | Reusable Components and Data Flow
Introduction to React

Challenge: Render a Movie List

Swipe to show menu

Task

Render a list of movies using the map() method.

The MovieList component must include:

  1. A ul element.

  2. Render a li element for each movie inside the movies array using map().

  3. Each li element must:

    • Display the movie title.
    • Include a unique key prop equal to movie.id.

The App component already passes the moviesData array to the MovieList component.

Starter Code

Open the starter project below and complete the missing parts of the component.

Starter code

Solution

You can compare your result with the final solution below.

Solution code

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 6

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Section 2. Chapter 6
some-alt