Skip to content

Commit c259560

Browse files
committed
docs: translate first section
1 parent 1332ff9 commit c259560

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/content/learn/rendering-lists.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Anda mungkin ingin menampilkan beberapa komponen yang mirip dari sebuah kumpulan
1616

1717
</YouWillLearn>
1818

19-
## Rendering data from arrays {/*rendering-data-from-arrays*/}
19+
## Me-*render* data dari seranai {/*rendering-data-from-arrays*/}
2020

21-
Say that you have a list of content.
21+
Misalkan Anda memiliki daftar konten seperti berikut.
2222

2323
```js
2424
<ul>
@@ -30,11 +30,11 @@ Say that you have a list of content.
3030
</ul>
3131
```
3232

33-
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.
33+
Semua anggota dari daftar tersebut memiliki format yang sama. Perbedaan hanya terletak pada isi konten, lebih tepatnya data mereka. Pada beberapa situasi, Anda mungkin harus menampilkan beberapa komponen yang sama dengan data yang berbeda saat membangun antarmuka, seperti daftar komentar atau galeri foto profil. Dalam situasi-situasi tersebut, Anda bisa menyimpan data tersebut ke dalam objek atau seranai JavaScript dengan menggunakan *method* [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) dan [`filter()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) yang kemudian akan digunakan untuk me-*render* beberapa komponen.
3434

35-
Here’s a short example of how to generate a list of items from an array:
35+
Contoh untuk membuat sebuah daftar dari sebuah seranai:
3636

37-
1. **Move** the data into an array:
37+
1. **Pindahkan** data ke sebuah seranai:
3838

3939
```js
4040
const people = [
@@ -46,19 +46,19 @@ const people = [
4646
];
4747
```
4848

49-
2. **Map** the `people` members into a new array of JSX nodes, `listItems`:
49+
2. **Petakan** dengan menggunakan *method* `map()` setiap anggota `people` ke sebuah seranai *node* JSX, `listItems`:
5050

5151
```js
5252
const listItems = people.map(person => <li>{person}</li>);
5353
```
5454

55-
3. **Return** `listItems` from your component wrapped in a `<ul>`:
55+
3. **Kembalikan** `listItems` dari komponen Anda dengan membungkusnya terlebih dahulu dengan elemen `<ul>`:
5656

5757
```js
5858
return <ul>{listItems}</ul>;
5959
```
6060

61-
Here is the result:
61+
Hasilnya seperti berikut:
6262

6363
<Sandpack>
6464

@@ -85,15 +85,15 @@ li { margin-bottom: 10px; }
8585

8686
</Sandpack>
8787

88-
Notice the sandbox above displays a console error:
88+
Perhatikan bahwa *sandbox* di atas menampilkan pesan kesalahan:
8989

9090
<ConsoleBlock level="error">
9191

9292
Warning: Each child in a list should have a unique "key" prop.
9393

9494
</ConsoleBlock>
9595

96-
You'll learn how to fix this error later on this page. Before we get to that, let's add some structure to your data.
96+
Anda akan mempelajari cara memperbaiki kesalahan ini nanti. Untuk saat ini, kita akan menambahkan struktur ke data Anda.
9797

9898
## Filtering arrays of items {/*filtering-arrays-of-items*/}
9999

0 commit comments

Comments
 (0)