You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Delaying a Pending Indicator](#delaying-a-pending-indicator)
@@ -358,31 +358,31 @@ Ketika tombol diklik, ia akan memulai transisi dan memanggil `props.onClick()` d
358
358
359
359
Kita dapat melihat bagaimana mode Concurrent membantu kita mendapatkan pengalaman pengguna yang baik tanpa mengorbankan isolasi dan modularitas dari komponen. React mengkoordinasikan transisinya.
360
360
361
-
## The Three Steps {#the-three-steps}
361
+
## Tiga Langkah {#the-three-steps}
362
362
363
-
By now we have discussed all of the different visual states that an update may go through. In this section, we will give them names and talk about the progression between them.
363
+
Sampai titik ini, kita telah mendiskusikan berbagai macam kondisi visual berbeda yang ditelusuri sebuah pembaruan data. Di bagian ini, kita akan memberikan mereka nama dan menjelaskan perjalanan di antaranya.
At the very end, we have the **Complete** state. That's where we want to eventually get to. It represents the moment when the next screen is fully rendered and isn't loading more data.
369
+
Di paling akhir, terdapat _state_**Complete**. Inilah _state_ yang ingin kita tuju. _State_ ini merepresentasikan moment di mana layar selanjutnya di-_render_ secara penuh dan tidak lagi memuat data.
370
370
371
-
But before our screen can be Complete, we might need to load some data or code. When we're on the next screen, but some parts of it are still loading, we call that a **Skeleton** state.
371
+
Namun sebelum layar kita menjadi Complete, kita mungkin perlu memuat data atau kode. Ketika kita berada di layar selanjutnya, namun beberapa bagian data tersebut masih memuat, kita sebut _state_ tersebut sebagai **Skeleton**.
372
372
373
-
Finally, there are two primary ways that lead us to the Skeleton state. We will illustrate the difference between them with a concrete example.
373
+
Akhirnya, ada dua cara utama yang membawa kita ke _state_Skeleton. Kita akan mengilustrasikan perbedaan di antaranya dengan contoh konkret.
Open [this example](https://codesandbox.io/s/prod-grass-g1lh5)and click "Open Profile". You will see several visual states one by one:
377
+
Bukalah [contoh berikut](https://codesandbox.io/s/prod-grass-g1lh5)dan tekan "Open Profile". Anda akan melihat beberapa _state_visual satu persatu:
378
378
379
-
***Receded**: For a second, you will see the `<h1>Loading the app...</h1>` fallback.
380
-
***Skeleton:**You will see the`<ProfilePage>`component with `<h2>Loading posts...</h2>`inside.
381
-
***Complete:**You will see the`<ProfilePage>`component with no fallbacks inside. Everything was fetched.
379
+
***Receded**: Untuk beberapa saat, Anda akan melihat kondisi _fallback_`<h1>Loading the app...</h1>`.
380
+
***Skeleton:**Anda akan melihat komponen`<ProfilePage>`dengan `<h2>Loading posts...</h2>`di dalamnya.
381
+
***Complete:**Anda akan melihat komponen`<ProfilePage>`tanpa _fallback_. Seluruh data dimuat.
382
382
383
-
How do we separate the Receded and the Skeleton states? The difference between them is that the **Receded**state feels like "taking a step back" to the user, while the**Skeleton**state feels like "taking a step forward" in our progress to show more content.
383
+
Bagaimana caranya kita memisahkan _state_ Receded dan Skeleton? Perbedaan di antara keduanya adalah _state_**Receded**terasa seperti "mengambil langkah mundur" kepada pengguna, dan _state_**Skeleton**terasa seperti "mengambil langkah maju" dalam perjalanan kita menampilkan lebih banyak konten.
384
384
385
-
In this example, we started our journey on the`<HomePage>`:
385
+
Dalam contoh berikut, perjalanan kita dimulai di`<HomePage>`:
386
386
387
387
```js
388
388
<Suspense fallback={...}>
@@ -391,7 +391,7 @@ In this example, we started our journey on the `<HomePage>`:
391
391
</Suspense>
392
392
```
393
393
394
-
After the click, React started rendering the next screen:
394
+
Setelah kita mengeklik, React memulai me-_render_ layar selanjutnya:
395
395
396
396
```js
397
397
<Suspense fallback={...}>
@@ -405,7 +405,7 @@ After the click, React started rendering the next screen:
405
405
</Suspense>
406
406
```
407
407
408
-
Both `<ProfileDetails>`and`<ProfileTimeline>`need data to render, so they suspend:
408
+
`<ProfileDetails>`dan`<ProfileTimeline>`memerlukan data untuk di-_render_, jadi kedua komponen tersebut ditunda:
409
409
410
410
```js{4,6}
411
411
<Suspense fallback={...}>
@@ -419,11 +419,11 @@ Both `<ProfileDetails>` and `<ProfileTimeline>` need data to render, so they sus
419
419
</Suspense>
420
420
```
421
421
422
-
When a component suspends, React needs to show the closest fallback. But the closest fallback to`<ProfileDetails>`is at the top level:
422
+
Saat komponen ditunda, React perlu menunjukkan komponen _fallback_ terdekat. Namun, komponen _fallback_ terdekat dari`<ProfileDetails>`terletak di tingkat atas:
423
423
424
424
```js{2,3,7}
425
425
<Suspense fallback={
426
-
// We see this fallback now because of <ProfileDetails>
426
+
// Kita melihat _fallback_ ini karena <ProfileDetails>
427
427
<h1>Loading the app...</h1>
428
428
}>
429
429
{/* next screen */}
@@ -436,9 +436,9 @@ When a component suspends, React needs to show the closest fallback. But the clo
436
436
</Suspense>
437
437
```
438
438
439
-
This is why when we click the button, it feels like we've "taken a step back". The`<Suspense>`boundary which was previously showing useful content (`<HomePage />`) had to "recede" to showing the fallback (`<h1>Loading the app...</h1>`). We call that a**Receded** state.
439
+
Inilah mengapa kita kita mengklik tombol, terasa seperti kita "mengambil langkah mundur". Perbatasan`<Suspense>`yang sebelumnya menunjukkan konten (`<HomePage />`) yang dapat digunakan harus "mundur" untuk menunjukkan komponen _fallback_ (`<h1>Loading the app...</h1>`). Kita menyebut _state_ tersebut**Receded**.
440
440
441
-
As we load more data, React will retry rendering, and`<ProfileDetails>`can render successfully. Finally, we're in the **Skeleton** state. We see the new page with missing parts:
441
+
Saat kita memuat lebih banyak data, React akan mencoba ulang untuk me-_render_, dan`<ProfileDetails>`dapat di-_render_ secara sukses. Akhirnya, kita berada di _state_**Skeleton**. Kita melihat halaman baru dengan beberapa bagian yang hilang:
442
442
443
443
```js{6,7,9}
444
444
<Suspense fallback={...}>
@@ -455,11 +455,11 @@ As we load more data, React will retry rendering, and `<ProfileDetails>` can ren
455
455
</Suspense>
456
456
```
457
457
458
-
Eventually, they load too, and we get to the **Complete** state.
458
+
Suatu saat, bagian-bagian tersebut akan dimuat juga, dan kita mencapai _state_**Complete**.
459
459
460
-
This scenario (Receded → Skeleton → Complete) is the default one. However, the Receded state is not very pleasant because it "hides" existing information. This is why React lets us opt into a different sequence (**Pending** → Skeleton → Complete) with`useTransition`.
460
+
Skenario ini (Receded → Skeleton → Complete) adalah skenario bawaan. Namun, _state_ Receded bukanlah pengalaman pengguna yang baik karena ia "menyembunyikan" informasi yang telah ada. Inilah mengapa React memungkinkan kita untuk memilih urutan berbeda (**Pending** → Skeleton → Complete) dengan`useTransition`.
When we `useTransition`, React will let us "stay" on the previous screen -- and show a progress indicator there. We call that a **Pending** state. It feels much better than the Receded state because none of our existing content disappears, and the page stays interactive.
0 commit comments