` to your markup, you can write `<>` and
>
```
-This empty tag is called a *[Fragment.](/reference/react/Fragment)* Fragments let you group things without leaving any trace in the browser HTML tree.
+*Tag* kosong di atas disebut *[Fragment.](/reference/react/Fragment)* *Fragments* dapat menggabungkan beberapa *tag* tanpa memasukkan *tag* tersebut ke bagian dari HTML.
-#### Why do multiple JSX tags need to be wrapped? {/*why-do-multiple-jsx-tags-need-to-be-wrapped*/}
+#### Mengapa beberapa tag JSX perlu dibungkus? {/*why-do-multiple-jsx-tags-need-to-be-wrapped*/}
-JSX looks like HTML, but under the hood it is transformed into plain JavaScript objects. You can't return two objects from a function without wrapping them into an array. This explains why you also can't return two JSX tags without wrapping them into another tag or a Fragment.
+JSX mirip dengan HTML, namun di balik layar, mereka berubah menjadi objek *literal* JavaScript. Anda tidak bisa mengembalikan dua objek dari sebuah fungsi tanpa membungkus mereka ke sebuah senarai. Inilah mengapa anda juga tidak bisa mengembalikan dua *tag* JSX tanpa membungkus mereka menjadi sebuah *fragment*.
-### 2. Close all the tags {/*2-close-all-the-tags*/}
+### 2. Tutup semua tag {/*2-close-all-the-tags*/}
-JSX requires tags to be explicitly closed: self-closing tags like `
` must become `
`, and wrapping tags like `
oranges` must be written as `oranges`.
+Semua *tag* JSX harus dapat ditutup: *tag* tunggal seperti `
` harus ditulis `
`, dan *tag* ganda seperti `
oranges` harus ditulis `oranges`.
-This is how Hedy Lamarr's image and list items look closed:
+Berikut adalah gambar dan daftar tugas Putri dengan *tag* ganda:
```js {2-6,8-10}
<>
- - Invent new traffic lights
- - Rehearse a movie scene
- - Improve the spectrum technology
+ - Mengerjakan PR
+ - Pergi Belanja
+ - Minum vitamin
>
```
-### 3. camelCase
all most of the things! {/*3-camelcase-salls-most-of-the-things*/}
+### 3. Ubah
semua sebagian menjadi camelCase! {/*3-camelcase-salls-most-of-the-things*/}
-JSX turns into JavaScript and attributes written in JSX become keys of JavaScript objects. In your own components, you will often want to read those attributes into variables. But JavaScript has limitations on variable names. For example, their names can't contain dashes or be reserved words like `class`.
+JSX berubah menjadi JavaScript dan atribut yang dituis di JSX menjadi *key* pada objek di JavaScript. Dalam komponen, atribut akan lebih mudah dibaca sebagai *variable*. Namun JavaScript memiliki beberapa batasan dalam menamai *variable*. Contohnya, nama *variable* tidak boleh terdiri dari karakter minus dan tidak boleh menggunakan nama pesanan tertentu seperti `class`.
-This is why, in React, many HTML and SVG attributes are written in camelCase. For example, instead of `stroke-width` you use `strokeWidth`. Since `class` is a reserved word, in React you write `className` instead, named after the [corresponding DOM property](https://developer.mozilla.org/en-US/docs/Web/API/Element/className):
+Inilah mengapa di React, banyak atribut HTML dan SVG ditulis secara camelCase. Contohnya, `stroke-width` dapat ditulis sebagai `strokeWidth`. Dan karena `class` merupakan nama pesanan, di React kita menulisnya sebagai `className`, dinamakan sesuai dengan [versi DOM-nya](https://developer.mozilla.org/en-US/docs/Web/API/Element/className):
```js {4}
```
-You can [find all these attributes in the list of DOM component props.](/reference/react-dom/components/common) If you get one wrong, don't worry—React will print a message with a possible correction to the [browser console.](https://developer.mozilla.org/docs/Tools/Browser_Console)
+Anda dapat [mencari semua atribut pada list DOM component berikut.](/reference/react-dom/components/common) Jika ada yang salah, jangan takut—React akan menampilkan pesan dengan koreksi ke [konsol di peramban.](https://developer.mozilla.org/docs/Tools/Browser_Console)
-For historical reasons, [`aria-*`](https://developer.mozilla.org/docs/Web/Accessibility/ARIA) and [`data-*`](https://developer.mozilla.org/docs/Learn/HTML/Howto/Use_data_attributes) attributes are written as in HTML with dashes.
+Untuk beberapa alasan, atribut [`aria-*`](https://developer.mozilla.org/docs/Web/Accessibility/ARIA) dan [`data-*`](https://developer.mozilla.org/docs/Learn/HTML/Howto/Use_data_attributes) ditulis menggunakan tanda minus.
-### Pro-tip: Use a JSX Converter {/*pro-tip-use-a-jsx-converter*/}
+### Tip: Gunakan JSX Converter {/*pro-tip-use-a-jsx-converter*/}
-Converting all these attributes in existing markup can be tedious! We recommend using a [converter](https://transform.tools/html-to-jsx) to translate your existing HTML and SVG to JSX. Converters are very useful in practice, but it's still worth understanding what is going on so that you can comfortably write JSX on your own.
+Mengubah atribut di markup yang sudah ada bisa menjadi membosankan! Kami sarankan untuk menggunakan *[converter](https://transform.tools/html-to-jsx)* untuk mengubah HTML dan SVG-mu menjadi JSX.
+Converters are very useful in practice, but it's still worth understanding what is going on so that you can comfortably write JSX on your own.
-Here is your final result:
+Berikut hasil jadinya:
@@ -234,16 +236,16 @@ Here is your final result:
export default function TodoList() {
return (
<>
- Hedy Lamarr's Todos
+ Daftar Tugas Putri
- - Invent new traffic lights
- - Rehearse a movie scene
- - Improve the spectrum technology
+ - Mengerjakan PR
+ - Pergi Belanja
+ - Minum vitamin
>
);
@@ -258,11 +260,11 @@ img { height: 90px }
-Now you know why JSX exists and how to use it in components:
+Sekarang anda paham mengapa ada JSX dan cara menggunakannya pada komponen:
-* React components group rendering logic together with markup because they are related.
-* JSX is similar to HTML, with a few differences. You can use a [converter](https://transform.tools/html-to-jsx) if you need to.
-* Error messages will often point you in the right direction to fixing your markup.
+* Komponen React menggabungkan logika *render* dengan *markup* karena mereka berkaitan.
+* JSX mirip dengan HTML, dengan beberapa perbedaan. Anda bisa menggunakan [converter](https://transform.tools/html-to-jsx) jika diperlukan.
+* Pesan error umumnya mengarahkan anda ke sumber masalah pada *markup*.
@@ -270,9 +272,9 @@ Now you know why JSX exists and how to use it in components:
-#### Convert some HTML to JSX {/*convert-some-html-to-jsx*/}
+#### Mengubah beberapa HTML menjadi JSX {/*convert-some-html-to-jsx*/}
-This HTML was pasted into a component, but it's not valid JSX. Fix it:
+HTML berikut telah disalin ke sebuah komponen, tapi bukan JSX yang valid. Coba perbaiki:
@@ -280,12 +282,12 @@ This HTML was pasted into a component, but it's not valid JSX. Fix it:
export default function Bio() {
return (
-
Welcome to my website!
+ Selamat datang di website saya!
- You can find my thoughts here.
+ Anda dapat membaca uneg-unegku di sini.
- And pictures of scientists!
+ Juga ada foto ilmuwan!
);
}
@@ -308,7 +310,7 @@ export default function Bio() {
-Whether to do it by hand or using the converter is up to you!
+Antara melakukannya dengan manual atau menggunakan *converter*, terserah Anda!
@@ -319,12 +321,12 @@ export default function Bio() {
return (
-
Welcome to my website!
+ Selamat datang di website saya!
- You can find my thoughts here.
+ Anda dapat menemukan pemikiran saya di sini.
- And pictures of scientists!
+ Juga ada foto-fotopara ilmuwan!
);