Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Челендж: Рендеринг Набору Даних | Вступ до Основ React
Опановуємо React
course content

Зміст курсу

Опановуємо React

Опановуємо React

4. React в Реальному Світі

Челендж: Рендеринг Набору Даних

Завдання: Показати список товарів

Обробимо дані, отримані з бекенду, і забезпечимо їх коректне відображення у форматі списку.

Задача така:

  • Використати метод map() для відображення масиву товарів.
  • Забезпечити заповнення необхідних пропусків:
    1. h2 повинен містити назву товару (властивість name).
    2. p повинен містити опис товару (властивість description).
    3. span повинен містити рядок "Price:" і ціну товару (властивість price).
  1. Use the map() method to map over the props.goods array.
  2. Ensure to set the key prop of the <li> element to a unique value, such as the id property of the item.
  3. Inside each <li> element, use the following elements:
    • An <h2> element to display the good's name. Access the name from the current item;
    • <p> element to display the good's description. Access the description from the current item;
    • <span> element to display the string "Price:" followed by the good's price. Access the price from the current item.

Все було зрозуміло?

Секція 1. Розділ 15
We're sorry to hear that something went wrong. What happened?
some-alt