Skip to content

Commit 1d989ab

Browse files
mustafamilyasresir014arfianadammazipan
authored
New Indonesia translation: Describing the UI page (#332)
Co-authored-by: Resi Respati <resir014@gmail.com> Co-authored-by: Arfian Adam <arfianadam@gmail.com> Co-authored-by: Irfan Maulana <mazipanneh@gmail.com>
1 parent dcd2744 commit 1d989ab

File tree

2 files changed

+77
-77
lines changed

2 files changed

+77
-77
lines changed

src/content/learn/describing-the-ui.md

+76-76
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
---
2-
title: Describing the UI
2+
title: Menggambarkan Antarmuka Pengguna (UI)
33
---
44

55
<Intro>
66

7-
React is a JavaScript library for rendering user interfaces (UI). UI is built from small units like buttons, text, and images. React lets you combine them into reusable, nestable *components.* From web sites to phone apps, everything on the screen can be broken down into components. In this chapter, you'll learn to create, customize, and conditionally display React components.
7+
React adalah pustaka JavaScript untuk melakukan *render* antarmuka pengguna (*User Interface* - UI). UI dibangun dari unit-unit kecil seperti tombol, teks, dan gambar. React memungkinkan Anda menggabungkan unit-unit tersebut menjadi suatu komponen yang *reusable* (dapat digunakan kembali), dan *nestable* (dapat diletakkan secara bersarang dan/atau di bawah komponen lainnya). Dari situs web hingga aplikasi, semua yang ada pada layar dapat dipecah menjadi komponen. Dalam bab ini, Anda akan belajar membuat, menyesuaikan, dan menampilkan komponen React secara kondisional.
88

99
</Intro>
1010

1111
<YouWillLearn isChapter={true}>
1212

13-
* [How to write your first React component](/learn/your-first-component)
14-
* [When and how to create multi-component files](/learn/importing-and-exporting-components)
15-
* [How to add markup to JavaScript with JSX](/learn/writing-markup-with-jsx)
16-
* [How to use curly braces with JSX to access JavaScript functionality from your components](/learn/javascript-in-jsx-with-curly-braces)
17-
* [How to configure components with props](/learn/passing-props-to-a-component)
18-
* [How to conditionally render components](/learn/conditional-rendering)
19-
* [How to render multiple components at a time](/learn/rendering-lists)
20-
* [How to avoid confusing bugs by keeping components pure](/learn/keeping-components-pure)
13+
* [Cara menulis komponen React pertama Anda](/learn/your-first-component)
14+
* [Kapan dan bagaimana membuat file multi-komponen](/learn/importing-and-exporting-components)
15+
* [Cara menambahkan markup ke JavaScript dengan JSX](/learn/writing-markup-with-jsx)
16+
* [Cara menggunakan kurung kurawal dengan JSX untuk mengakses fungsionalitas JavaScript dari komponen Anda](/learn/javascript-in-jsx-with-curly-braces)
17+
* [Cara mengonfigurasi komponen dengan props](/learn/passing-props-to-a-component)
18+
* [Cara melakukan render komponen secara kondisional](/learn/conditional-rendering)
19+
* [Cara melakukan render beberapa komponen sekaligus](/learn/rendering-lists)
20+
* [Cara menghindari bug yang membingungkan dengan menjaga komponen tetap murni](/learn/keeping-components-pure)
2121

2222
</YouWillLearn>
2323

24-
## Your first component {/*your-first-component*/}
24+
## Komponen Pertama Anda {/*your-first-component*/}
2525

26-
React applications are built from isolated pieces of UI called *components*. A React component is a JavaScript function that you can sprinkle with markup. Components can be as small as a button, or as large as an entire page. Here is a `Gallery` component rendering three `Profile` components:
26+
Aplikasi React dibangun dari potongan-potongan antarmuka pengguna (UI) yang terisolasi yang disebut *komponen*. Komponen React adalah sebuah fungsi JavaScript yang dapat Anda tambahkan dengan *markup*. Komponen dapat sekecil tombol atau sebesar halaman utuh. Berikut adalah contoh komponen `Gallery` yang me-*render* tiga komponen `Profile`:
2727

2828
<Sandpack>
2929

@@ -40,7 +40,7 @@ function Profile() {
4040
export default function Gallery() {
4141
return (
4242
<section>
43-
<h1>Amazing scientists</h1>
43+
<h1>Ilmuwan yang luar biasa</h1>
4444
<Profile />
4545
<Profile />
4646
<Profile />
@@ -57,13 +57,13 @@ img { margin: 0 10px 10px 0; height: 90px; }
5757

5858
<LearnMore path="/learn/your-first-component">
5959

60-
Read **[Your First Component](/learn/your-first-component)** to learn how to declare and use React components.
60+
Baca **[Komponen Pertama Anda](/learn/your-first-component)** untuk mempelajari cara mendeklarasikan dan menggunakan komponen React.
6161

6262
</LearnMore>
6363

64-
## Importing and exporting components {/*importing-and-exporting-components*/}
64+
## Mengimpor dan Mengekspor Komponen {/*importing-and-exporting-components*/}
6565

66-
You can declare many components in one file, but large files can get difficult to navigate. To solve this, you can *export* a component into its own file, and then *import* that component from another file:
66+
Anda dapat mendeklarasikan banyak komponen dalam satu file, tetapi file yang besar dapat menjadi sulit untuk dinavigasi/dibaca. Untuk memecahkan masalah ini, Anda dapat *mengekspor* sebuah komponen ke dalam file sendiri, dan kemudian *mengimpor* komponen tersebut dari file lain:
6767

6868

6969
<Sandpack>
@@ -84,7 +84,7 @@ import Profile from './Profile.js';
8484
export default function Gallery() {
8585
return (
8686
<section>
87-
<h1>Amazing scientists</h1>
87+
<h1>Ilmuwan yang luar biasa</h1>
8888
<Profile />
8989
<Profile />
9090
<Profile />
@@ -112,32 +112,32 @@ img { margin: 0 10px 10px 0; }
112112

113113
<LearnMore path="/learn/importing-and-exporting-components">
114114

115-
Read **[Importing and Exporting Components](/learn/importing-and-exporting-components)** to learn how to split components into their own files.
115+
Baca **[Mengimpor dan Mengekspor Komponen](/learn/importing-and-exporting-components)** untuk belajar bagaimana memecah komponen ke dalam file-file terpisah.
116116

117117
</LearnMore>
118118

119-
## Writing markup with JSX {/*writing-markup-with-jsx*/}
119+
## Menulis markup dengan JSX {/*writing-markup-with-jsx*/}
120120

121-
Each React component is a JavaScript function that may contain some markup that React renders into the browser. React components use a syntax extension called JSX to represent that markup. JSX looks a lot like HTML, but it is a bit stricter and can display dynamic information.
121+
Setiap komponen React adalah sebuah fungsi JavaScript yang dapat berisi beberapa *markup* yang di-*render* oleh React ke peramban. Komponen React menggunakan ekstensi sintaksis bernama JSX untuk merepresentasikan *markup* tersebut. JSX terlihat mirip dengan HTML, tetapi sedikit lebih ketat dan dapat menampilkan informasi yang dinamis.
122122

123-
If we paste existing HTML markup into a React component, it won't always work:
123+
Menempel *markup* HTML ke dalam komponen React tidak selalu akan berfungsi:
124124

125125
<Sandpack>
126126

127127
```js
128128
export default function TodoList() {
129129
return (
130-
// This doesn't quite work!
130+
// Ini tidak cukup berhasil
131131
<h1>Hedy Lamarr's Todos</h1>
132132
<img
133133
src="https://i.imgur.com/yXOvdOSs.jpg"
134134
alt="Hedy Lamarr"
135135
class="photo"
136136
>
137137
<ul>
138-
<li>Invent new traffic lights
139-
<li>Rehearse a movie scene
140-
<li>Improve spectrum technology
138+
<li>Ciptakan lampu lalu lintas baru
139+
<li>Latih adegan film
140+
<li>Meningkatkan teknologi spektrum
141141
</ul>
142142
);
143143
}
@@ -149,7 +149,7 @@ img { height: 90px; }
149149
150150
</Sandpack>
151151
152-
If you have existing HTML like this, you can fix it using a [converter](https://transform.tools/html-to-jsx):
152+
Jika Anda memiliki HTML seperti ini, Anda dapat memperbaikinya menggunakan [konverter](https://transform.tools/html-to-jsx):
153153
154154
<Sandpack>
155155
@@ -164,9 +164,9 @@ export default function TodoList() {
164164
className="photo"
165165
/>
166166
<ul>
167-
<li>Invent new traffic lights</li>
168-
<li>Rehearse a movie scene</li>
169-
<li>Improve spectrum technology</li>
167+
<li>Ciptakan lampu lalu lintas baru</li>
168+
<li>Latih adegan film</li>
169+
<li>Meningkatkan teknologi spektrum</li>
170170
</ul>
171171
</>
172172
);
@@ -181,13 +181,13 @@ img { height: 90px; }
181181

182182
<LearnMore path="/learn/writing-markup-with-jsx">
183183

184-
Read **[Writing Markup with JSX](/learn/writing-markup-with-jsx)** to learn how to write valid JSX.
184+
Baca **[Menulis Markup dengan JSX](/learn/writing-markup-with-jsx)** untuk mempelajarai cara menulis JSX yang valid.
185185

186186
</LearnMore>
187187

188-
## JavaScript in JSX with curly braces {/*javascript-in-jsx-with-curly-braces*/}
188+
## JavaScript di dalam JSX dengan kurung kurawal {/*javascript-in-jsx-with-curly-braces*/}
189189

190-
JSX lets you write HTML-like markup inside a JavaScript file, keeping rendering logic and content in the same place. Sometimes you will want to add a little JavaScript logic or reference a dynamic property inside that markup. In this situation, you can use curly braces in your JSX to "open a window" to JavaScript:
190+
JSX memungkinkan Anda menulis *markup* mirip HTML di dalam file JavaScript, menjaga logika *rendering* dan konten di tempat yang sama. Terkadang Anda ingin menambahkan sedikit logika JavaScript atau merujuk pada properti dinamis di dalam markup tersebut. Dalam situasi ini, Anda dapat menggunakan kurung kurawal di JSX Anda untuk "membuka jendela" ke JavaScript:
191191

192192
<Sandpack>
193193

@@ -210,9 +210,9 @@ export default function TodoList() {
210210
alt="Gregorio Y. Zara"
211211
/>
212212
<ul>
213-
<li>Improve the videophone</li>
214-
<li>Prepare aeronautics lectures</li>
215-
<li>Work on the alcohol-fuelled engine</li>
213+
<li>Meningkatkan videophone</li>
214+
<li>Menyiapkan kuliah aeronautika</li>
215+
<li>Mengerjakan mesin berbahan bakar alkohol</li>
216216
</ul>
217217
</div>
218218
);
@@ -229,13 +229,13 @@ body > div > div { padding: 20px; }
229229
230230
<LearnMore path="/learn/javascript-in-jsx-with-curly-braces">
231231
232-
Read **[JavaScript in JSX with Curly Braces](/learn/javascript-in-jsx-with-curly-braces)** to learn how to access JavaScript data from JSX.
232+
Baca **[JavaScript di dalam JSX dengan Kurung Kurawal](/learn/javascript-in-jsx-with-curly-braces)** untuk mempelajari cara mengakses data JavaScript dari JSX.
233233
234234
</LearnMore>
235235
236-
## Passing props to a component {/*passing-props-to-a-component*/}
236+
## Mengoper Props ke sebuah Komponen {/*passing-props-to-a-component*/}
237237
238-
React components use *props* to communicate with each other. Every parent component can pass some information to its child components by giving them props. Props might remind you of HTML attributes, but you can pass any JavaScript value through them, including objects, arrays, functions, and even JSX!
238+
Komponen React menggunakan *props* untuk berkomunikasi satu sama lain. Setiap komponen induk dapat memberikan informasi ke komponen anaknya dengan memberikan *props*. *Props* mungkin mengingatkan Anda pada atribut HTML, tetapi Anda dapat mengoper nilai JavaScript apa pun melalui *props*, termasuk objek, senarai, fungsi, dan bahkan JSX!
239239
240240
<Sandpack>
241241
@@ -310,15 +310,15 @@ export function getImageUrl(person, size = 's') {
310310

311311
<LearnMore path="/learn/passing-props-to-a-component">
312312

313-
Read **[Passing Props to a Component](/learn/passing-props-to-a-component)** to learn how to pass and read props.
313+
Baca **[Mengoper Props ke sebuah Komponen](/learn/passing-props-to-a-component)** untuk mempelajari cara mengoper dan membaca *props*.
314314

315315
</LearnMore>
316316

317-
## Conditional rendering {/*conditional-rendering*/}
317+
## Merender Secara Kondisional {/*conditional-rendering*/}
318318

319-
Your components will often need to display different things depending on different conditions. In React, you can conditionally render JSX using JavaScript syntax like `if` statements, `&&`, and `? :` operators.
319+
Komponen Anda seringkali perlu menampilkan hal-hal yang berbeda tergantung pada kondisi yang berbeda. Di React, Anda dapat me-*render* JSX secara kondisional menggunakan sintaks JavaScript seperti `if` *statements*, `&&`, dan `?:` operator.
320320

321-
In this example, the JavaScript `&&` operator is used to conditionally render a checkmark:
321+
Dalam contoh ini, operator `&&` JavaScript digunakan untuk me-*render* centang secara kondisional:
322322

323323
<Sandpack>
324324

@@ -334,19 +334,19 @@ function Item({ name, isPacked }) {
334334
export default function PackingList() {
335335
return (
336336
<section>
337-
<h1>Sally Ride's Packing List</h1>
337+
<h1>Daftar Perlengkapan Sally Ride</h1>
338338
<ul>
339339
<Item
340340
isPacked={true}
341-
name="Space suit"
341+
name="Pakaian luar angkasa"
342342
/>
343343
<Item
344344
isPacked={true}
345-
name="Helmet with a golden leaf"
345+
name="Helm dengan daun emas"
346346
/>
347347
<Item
348348
isPacked={false}
349-
name="Photo of Tam"
349+
name="Foto Tam"
350350
/>
351351
</ul>
352352
</section>
@@ -358,15 +358,15 @@ export default function PackingList() {
358358

359359
<LearnMore path="/learn/conditional-rendering">
360360

361-
Read **[Conditional Rendering](/learn/conditional-rendering)** to learn the different ways to render content conditionally.
361+
Baca **[Merender Secara Kondisional](/learn/conditional-rendering)** untuk mempelajari cara merender konten secara kondisional.
362362

363363
</LearnMore>
364364

365-
## Rendering lists {/*rendering-lists*/}
365+
## Merender List {/*rendering-lists*/}
366366

367-
You will often want to display multiple similar components from a collection of data. You can use JavaScript's `filter()` and `map()` with React to filter and transform your array of data into an array of components.
367+
Anda akan sering ingin menampilkan beberapa komponen serupa dari koleksi data. Anda dapat menggunakan `filter()` dan `map()` dari JavaScript dengan React untuk menyaring dan mentransformasikan senarai data Anda menjadi senarai komponen.
368368

369-
For each array item, you will need to specify a `key`. Usually, you will want to use an ID from the database as a `key`. Keys let React keep track of each item's place in the list even if the list changes.
369+
Untuk setiap *item* pada senarai, Anda perlu menentukan sebuah kunci `key`. Biasanya, Anda ingin menggunakan ID dari basisdata sebagai `key`. `key` memungkinkan React untuk melacak posisi setiap *item* di dalam daftar bahkan jika daftar berubah.
370370

371371
<Sandpack>
372372

@@ -384,13 +384,13 @@ export default function List() {
384384
<p>
385385
<b>{person.name}:</b>
386386
{' ' + person.profession + ' '}
387-
known for {person.accomplishment}
387+
yang terkenal dengan {person.accomplishment}
388388
</p>
389389
</li>
390390
);
391391
return (
392392
<article>
393-
<h1>Scientists</h1>
393+
<h1>Ilmuwan</h1>
394394
<ul>{listItems}</ul>
395395
</article>
396396
);
@@ -401,32 +401,32 @@ export default function List() {
401401
export const people = [{
402402
id: 0,
403403
name: 'Creola Katherine Johnson',
404-
profession: 'mathematician',
405-
accomplishment: 'spaceflight calculations',
404+
profession: 'ahli matematika',
405+
accomplishment: 'perhitungan penerbangan luar angkasa',
406406
imageId: 'MK3eW3A'
407407
}, {
408408
id: 1,
409409
name: 'Mario José Molina-Pasquel Henríquez',
410-
profession: 'chemist',
411-
accomplishment: 'discovery of Arctic ozone hole',
410+
profession: 'ahli kimia',
411+
accomplishment: 'penemuan lubang ozon Arktik',
412412
imageId: 'mynHUSa'
413413
}, {
414414
id: 2,
415415
name: 'Mohammad Abdus Salam',
416-
profession: 'physicist',
417-
accomplishment: 'electromagnetism theory',
416+
profession: 'ahli fisika',
417+
accomplishment: 'teori elektromagnetik',
418418
imageId: 'bE7W1ji'
419419
}, {
420420
id: 3,
421421
name: 'Percy Lavon Julian',
422-
profession: 'chemist',
423-
accomplishment: 'pioneering cortisone drugs, steroids and birth control pills',
422+
profession: 'ahli kimia',
423+
accomplishment: 'perintis obat kortison, steroid dan pil KB',
424424
imageId: 'IOjWm71'
425425
}, {
426426
id: 4,
427427
name: 'Subrahmanyan Chandrasekhar',
428-
profession: 'astrophysicist',
429-
accomplishment: 'white dwarf star mass calculations',
428+
profession: 'ahli astrofisika',
429+
accomplishment: 'perhitungan massa bintang kerdil putih',
430430
imageId: 'lrWQx8l'
431431
}];
432432
```
@@ -458,28 +458,28 @@ h2 { font-size: 20px; }
458458

459459
<LearnMore path="/learn/rendering-lists">
460460

461-
Read **[Rendering Lists](/learn/rendering-lists)** to learn how to render a list of components, and how to choose a key.
461+
Baca **[Merender List](/learn/rendering-lists)** untuk mempelajari cara me-*render* daftar komponen dan cara memilih `key`.
462462

463463
</LearnMore>
464464

465-
## Keeping components pure {/*keeping-components-pure*/}
465+
## Menjaga Komponen Tetap Murni {/*keeping-components-pure*/}
466466

467-
Some JavaScript functions are *pure.* A pure function:
467+
Sebagian fungsi JavaScript adalah murni (*pure*). Sebuah fungsi murni:
468468

469-
* **Minds its own business.** It does not change any objects or variables that existed before it was called.
470-
* **Same inputs, same output.** Given the same inputs, a pure function should always return the same result.
469+
* **Memperhatikan urusannya sendiri.** fungsi tidak mengubah objek atau variabel apapun yang ada sebelum fungsi dipanggil.
470+
* **_Input_ sama, _output_ sama.** Dengan *input* yang sama, sebuah fungsi murni harus selalu memiliki *output* yang sama.
471471

472-
By strictly only writing your components as pure functions, you can avoid an entire class of baffling bugs and unpredictable behavior as your codebase grows. Here is an example of an impure component:
472+
Dengan hanya benar-benar menulis komponen Anda sebagai fungsi murni, Anda dapat menghindari seluruh *bug* yang membingungkan dan perilaku yang tidak dapat diprediksi saat kode Anda berkembang. Berikut ini adalah contoh komponen tidak murni:
473473

474474
<Sandpack>
475475

476476
```js
477477
let guest = 0;
478478

479479
function Cup() {
480-
// Bad: changing a preexisting variable!
480+
// Buruk: memodifikasi variabel yang sudah ada sebelum Cup dipanggil!
481481
guest = guest + 1;
482-
return <h2>Tea cup for guest #{guest}</h2>;
482+
return <h2>Cangkir teh untuk tamu #{guest}</h2>;
483483
}
484484

485485
export default function TeaSet() {
@@ -495,13 +495,13 @@ export default function TeaSet() {
495495

496496
</Sandpack>
497497

498-
You can make this component pure by passing a prop instead of modifying a preexisting variable:
498+
Anda dapat membuat komponen ini menjadi murni dengan mengoper sebuah *prop* daripada memodifikasi variabel yang sudah ada:
499499

500500
<Sandpack>
501501

502502
```js
503503
function Cup({ guest }) {
504-
return <h2>Tea cup for guest #{guest}</h2>;
504+
return <h2>Cangkir teh untuk tamu #{guest}</h2>;
505505
}
506506

507507
export default function TeaSet() {
@@ -519,12 +519,12 @@ export default function TeaSet() {
519519

520520
<LearnMore path="/learn/keeping-components-pure">
521521

522-
Read **[Keeping Components Pure](/learn/keeping-components-pure)** to learn how to write components as pure, predictable functions.
522+
Baca **[Menjaga Komponen Tetap Murni](/learn/keeping-components-pure)** untuk mempelajari cara menulis komponen sebagai fungsi yang murni dan dapat diprediksi.
523523

524524
</LearnMore>
525525

526-
## What's next? {/*whats-next*/}
526+
## Apa selanjutnya? {/*whats-next*/}
527527

528-
Head over to [Your First Component](/learn/your-first-component) to start reading this chapter page by page!
528+
Lanjut ke [Komponen Pertama Anda](/learn/your-first-component) untuk mulai membaca halaman bab ini dari awal!
529529

530-
Or, if you're already familiar with these topics, why not read about [Adding Interactivity](/learn/adding-interactivity)?
530+
Atau, jika Anda sudah familiar dengan topik ini, mengapa tidak membaca tentang [Menambahkan Interaktivitas](/learn/adding-interactivity)?

src/sidebarLearn.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
},
187187
{
188188
"title": "Removing Effect Dependencies",
189-
"path": "/learn/removing-effect-dependencies"
189+
"path": "/learn/removing-effect-dependencies"
190190
},
191191
{
192192
"title": "Reusing Logic with Custom Hooks",

0 commit comments

Comments
 (0)