From 9f496e7d821733dd6b3abf0acf39589591f2ed1b Mon Sep 17 00:00:00 2001 From: alinkedd Date: Tue, 19 Dec 2023 06:09:16 +0200 Subject: [PATCH 1/2] Finished translation of Rendering Lists page --- TRANSLATION.md | 2 +- src/content/learn/rendering-lists.md | 548 +++++++++++++-------------- 2 files changed, 275 insertions(+), 275 deletions(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index 499aacae4..e8627af47 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -144,7 +144,7 @@ | React | React | | React element | React-елемент, елемент React | | reconciliation | узгодження | -| render(ing) | рендер, рендерити | +| render(ing) | рендер, рендерити (відрендерити) | | re-render(ing) | повторний рендер | | render prop | рендер-проп | | render props | рендер-пропси | diff --git a/src/content/learn/rendering-lists.md b/src/content/learn/rendering-lists.md index 108e394e2..8f4c1ecfe 100644 --- a/src/content/learn/rendering-lists.md +++ b/src/content/learn/rendering-lists.md @@ -1,74 +1,74 @@ --- -title: Rendering Lists +title: Рендеринг списків --- -You will often want to display multiple similar components from a collection of data. You can use the [JavaScript array methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#) to manipulate an array of data. On this page, you'll use [`filter()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) and [`map()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/map) with React to filter and transform your array of data into an array of components. +Часто потрібно показати кілька подібних компонентів із колекції даних. Ви можете використовувати [методи JavaScript для масивів](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#), щоб маніпулювати масивом даних. На цій сторінці ви використовуватиме [`filter()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) і [`map()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/map) разом з React для фільтрування та перетворення вашого масиву даних у масив компонентів. -* How to render components from an array using JavaScript's `map()` -* How to render only specific components using JavaScript's `filter()` -* When and why to use React keys +* Як рендерити компоненти з масиву, використовуючи `map()` з JavaScript +* Як рендерити лиш деякі компоненти, використовуючи `filter()` з JavaScript +* Коли і навіщо використовувати ключі React -## Rendering data from arrays {/*rendering-data-from-arrays*/} +## Рендеринг масивів даних {/*rendering-data-from-arrays*/} -Say that you have a list of content. +Припустимо, у вас є список певних даних. ```js ``` -The only difference among those list items is their contents, their data. You will often need to show several instances of the same component using different data when building interfaces: from lists of comments to galleries of profile images. In these situations, you can store that data in JavaScript objects and arrays and use methods like [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) and [`filter()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) to render lists of components from them. +Єдина відмінність між цими елементами списку полягає у їхньому вмісті, їхніх даних. Під час побудови інтерфейсів вам часто буде потрібно відобразити кілька екземплярів одного компонента, використовуючи різні дані — від списків коментарів до галерей зображень профілів. У цьому разі ви можете зберігати ці дані в об'єктах і масивах JavaScript та використовувати методи як [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) і [`filter()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/filter), щоб відрендерити з них списки компонентів. -Here’s a short example of how to generate a list of items from an array: +Ось короткий приклад того, як згенерувати список елементів із масиву: -1. **Move** the data into an array: +1. **Перенесіть** дані у масив: ```js const people = [ - 'Creola Katherine Johnson: mathematician', - 'Mario José Molina-Pasquel Henríquez: chemist', - 'Mohammad Abdus Salam: physicist', - 'Percy Lavon Julian: chemist', - 'Subrahmanyan Chandrasekhar: astrophysicist' + 'Кетрін Джонсон (Creola Katherine Johnson): математик', + 'Маріо Моліна (Mario José Molina-Pasquel Henríquez): хімік', + 'Абдус Салам (Moшинкаmad Abdus Salam): фізик', + 'Персі Джуліан (Percy Lavon Julian): хімік', + 'Субрахманьян Чандрасекар (Subrahmanyan Chandrasekhar): астрофізик' ]; ``` -2. **Map** the `people` members into a new array of JSX nodes, `listItems`: +1. **Перетворіть** члени масиву `people` у новий масив JSX-вузлів — `listItems`: ```js const listItems = people.map(person =>
  • {person}
  • ); ``` -3. **Return** `listItems` from your component wrapped in a `