Skip to content

Commit d7bd592

Browse files
authored
docs: translate page prefetchDNS (#716)
1 parent cb3625c commit d7bd592

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/content/reference/react-dom/prefetchDNS.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ canary: true
55

66
<Canary>
77

8-
The `prefetchDNS` function is currently only available in React's Canary and experimental channels. Learn more about [React's release channels here](/community/versioning-policy#all-release-channels).
8+
Fungsi `prefetchDNS` saat ini hanya tersedia di kanal Canary dan eksperimental React. Pelajari lebih lanjut tentang [kanal rilis React di sini](/community/versioning-policy#all-release-channels).
99

1010
</Canary>
1111

1212
<Intro>
1313

14-
`prefetchDNS` lets you eagerly look up the IP of a server that you expect to load resources from.
14+
`prefetchDNS` memungkinkan Anda mencari IP server yang Anda harapkan untuk memuat sumber daya.
1515

1616
```js
1717
prefetchDNS("https://example.com");
@@ -23,11 +23,11 @@ prefetchDNS("https://example.com");
2323

2424
---
2525

26-
## Reference {/*reference*/}
26+
## Referensi {/*reference*/}
2727

2828
### `prefetchDNS(href)` {/*prefetchdns*/}
2929

30-
To look up a host, call the `prefetchDNS` function from `react-dom`.
30+
Untuk mencari host, panggil fungsi `prefetchDNS` dari `react-dom`.
3131

3232
```js
3333
import { prefetchDNS } from 'react-dom';
@@ -39,34 +39,34 @@ function AppRoot() {
3939

4040
```
4141

42-
[See more examples below.](#usage)
42+
[Lihat lebih banyak contoh di bawah ini.](#usage)
4343

44-
The prefetchDNS function provides the browser with a hint that it should look up the IP address of a given server. If the browser chooses to do so, this can speed up the loading of resources from that server.
44+
Fungsi prefetchDNS memberikan petunjuk kepada browser untuk mencari alamat IP dari server tertentu. Jika browser memilih untuk melakukannya, hal ini dapat mempercepat pemuatan sumber daya dari server tersebut.
4545

46-
#### Parameters {/*parameters*/}
46+
#### Parameter {/*parameters*/}
4747

48-
* `href`: a string. The URL of the server you want to connect to.
48+
* `href`: sebuah string. URL server yang ingin Anda sambungkan.
4949

50-
#### Returns {/*returns*/}
50+
#### Kembalian {/*returns*/}
5151

52-
`prefetchDNS` returns nothing.
52+
`prefetchDNS` tidak mengembalikan apa pun.
5353

54-
#### Caveats {/*caveats*/}
54+
#### Peringatan {/*caveats*/}
5555

56-
* Multiple calls to `prefetchDNS` with the same server have the same effect as a single call.
57-
* In the browser, you can call `prefetchDNS` in any situation: while rendering a component, in an Effect, in an event handler, and so on.
58-
* In server-side rendering or when rendering Server Components, `prefetchDNS` only has an effect if you call it while rendering a component or in an async context originating from rendering a component. Any other calls will be ignored.
59-
* If you know the specific resources you'll need, you can call [other functions](/reference/react-dom/#resource-preloading-apis) instead that will start loading the resources right away.
60-
* There is no benefit to prefetching the same server the webpage itself is hosted from because it's already been looked up by the time the hint would be given.
61-
* Compared with [`preconnect`](/reference/react-dom/preconnect), `prefetchDNS` may be better if you are speculatively connecting to a large number of domains, in which case the overhead of preconnections might outweigh the benefit.
56+
* Beberapa panggilan ke `prefetchDNS` dengan server yang sama memiliki efek yang sama dengan panggilan tunggal.
57+
* Di browser, Anda dapat memanggil `prefetchDNS` dalam situasi apa pun: saat me-*render* komponen, di Effect, di *event handler*, dan sebagainya.
58+
* Dalam rendering sisi server atau saat me-*render* Komponen Server, `prefetchDNS` hanya memiliki efek jika Anda memanggilnya saat me-*render* komponen atau dalam konteks asinkronisasi yang berasal dari rendering komponen. Pemanggilan lainnya akan diabaikan.
59+
* Jika Anda mengetahui sumber daya spesifik yang Anda perlukan, Anda dapat memanggil [fungsi lain](/reference/react-dom/#resource-preloading-apis) sebagai gantinya yang akan langsung memuat sumber daya.
60+
* Tidak ada manfaatnya untuk mengambil sumber daya dari server yang sama dengan tempat halaman web dihosting karena sumber daya tersebut sudah dicari pada saat petunjuk diberikan.
61+
* Dibandingkan dengan [`preconnect`](/reference/react-dom/preconnect), `prefetchDNS` mungkin lebih baik jika Anda secara spekulatif menyambungkan ke sejumlah besar domain, yang mana dalam hal ini biaya tambahan untuk melakukan prapenghubungan bisa jadi lebih besar daripada manfaatnya.
6262

6363
---
6464

65-
## Usage {/*usage*/}
65+
## Penggunaan {/*usage*/}
6666

67-
### Prefetching DNS when rendering {/*prefetching-dns-when-rendering*/}
67+
### Melakukan prefetching DNS saat me-render {/*prefetching-dns-when-rendering*/}
6868

69-
Call `prefetchDNS` when rendering a component if you know that its children will load external resources from that host.
69+
Panggil `prefetchDNS` saat me-*render* komponen jika Anda mengetahui bahwa anak komponen akan memuat sumber daya eksternal dari host tersebut.
7070

7171
```js
7272
import { prefetchDNS } from 'react-dom';
@@ -77,9 +77,9 @@ function AppRoot() {
7777
}
7878
```
7979

80-
### Prefetching DNS in an event handler {/*prefetching-dns-in-an-event-handler*/}
80+
### Prefetching DNS pada event handler {/*prefetching-dns-in-an-event-handler*/}
8181

82-
Call `prefetchDNS` in an event handler before transitioning to a page or state where external resources will be needed. This gets the process started earlier than if you call it during the rendering of the new page or state.
82+
Panggil `prefetchDNS` di dalam *event handler* sebelum bertransisi ke halaman atau state yang membutuhkan sumber daya eksternal. Hal ini akan memulai proses lebih awal dibandingkan jika Anda memanggilnya saat me-*render* halaman atau state baru.
8383

8484
```js
8585
import { prefetchDNS } from 'react-dom';

0 commit comments

Comments
 (0)