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
*`load`: A function that returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)or another *thenable* (a Promise-like object with a `then`method). React will not call `load` until the first time you attempt to render the returned component. After React first calls `load`, it will wait for it to resolve, and then render the resolved value as a React component. Both the returned Promise and the Promise's resolved value will be cached, so React will not call `load` more than once. If the Promise rejects, React will `throw` the rejection reason for the nearest Error Boundary to handle.
35
+
*`load`: [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)veya başka bir *thenable* (`then`metoduna sahip Promise benzeri bir nesne) döndürmeniz gerekir. React, dönen bileşeni ilk kez render etmeye yeltenene kadar `load`'ı çağırmaz. React `load`'ı ilk çağırdığında, çözümlenene (resolve) kadar bekler, ardından çözümlenmiş değeri React bileşeni olarak render eder. Hem Promise hem de Promise'in çözümlenmiş değeri ön belleğe (cache) alınacağından, React `load`'ı birden fazla kez çağırmaz. Promise reddedilirse (reject), React reddetme nedenini ele alması için `throw` ile en yakındaki Error Boundary'ye gönderir.
36
36
37
-
#### Returns {/*returns*/}
37
+
#### Dönüş değerleri {/*returns*/}
38
+
39
+
`lazy`, ağacınıza render edebileceğiniz bir React bileşeni döndürür. Lazy bileşenin kodu yüklenirken, render etme işlemi *askıya alınır.* Yükleme esnasında yükleniyor göstergesi görüntülemek için [`<Suspense>`](/reference/react/Suspense) kullanın.
38
40
39
-
`lazy` returns a React component you can render in your tree. While the code for the lazy component is still loading, attempting to render it will *suspend.* Use [`<Suspense>`](/reference/react/Suspense) to display a loading indicator while it's loading.
40
41
41
42
---
42
43
43
-
### `load`function {/*load*/}
44
+
### `load`fonksiyonu {/*load*/}
44
45
45
-
#### Parameters {/*load-parameters*/}
46
+
#### Parametreler {/*load-parameters*/}
46
47
47
-
`load`receives no parameters.
48
+
`load`parametre almaz.
48
49
49
-
#### Returns {/*load-returns*/}
50
+
#### Dönüş değerleri {/*load-returns*/}
50
51
51
-
You need to return a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)or some other*thenable* (a Promise-like object with a `then`method). It needs to eventually resolve to a valid React component type, such as a function, [`memo`](/reference/react/memo), or a[`forwardRef`](/reference/react/forwardRef) component.
52
+
[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)veya başka bir*thenable* (`then`metoduna sahip Promise benzeri bir nesne) döndürmeniz gerekir. Bu nesne; fonksiyon, [`memo`](/reference/react/memo) ya da[`forwardRef`](/reference/react/forwardRef)'de olduğu gibi geçerli bir React bileşen tipine çözülmelidir.
52
53
53
54
---
54
55
55
-
## Usage {/*usage*/}
56
+
## Kullanım {/*usage*/}
56
57
57
-
### Lazy-loading components with Suspense {/*suspense-for-code-splitting*/}
58
+
### Suspense ile lazy yüklenen bileşenler {/*suspense-for-code-splitting*/}
58
59
59
-
Usually, you import components with the static [`import`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import)declaration:
60
+
Bileşenlerinizi çoğunlukla statik [`import`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import)tanımıyla içe aktarırsınız:
60
61
61
62
```js
62
63
importMarkdownPreviewfrom'./MarkdownPreview.js';
63
64
```
64
65
65
-
To defer loading this component's code until it's rendered for the first time, replace this import with:
66
+
Bileşen kodunun yüklenmesini ilk render'a kadar ertelemek istiyorsanız, şu içe aktarmayla değiştirin:
This code relies on [dynamic`import()`,](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import) which might require support from your bundler or framework.
74
+
Bu kod, [dinamik`import()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import)'a dayanır. Kullanmak için paketleyicinizin (bundler) veya framework'ünüzün desteklemesi gerekir.
74
75
75
-
Now that your component's code loads on demand, you also need to specify what should be displayed while it is loading. You can do this by wrapping the lazy component or any of its parents into a [`<Suspense>`](/reference/react/Suspense) boundary:
76
+
Artık bileşeninizin kodları talep edildiğinde (on demand) yüklendiğine göre, yüklenme aşamasında yerine neyin görüntüleneceğini belirtmeniz gerekir. Bunu, lazy bileşeni ya da üst bileşenlerinden birini [`<Suspense>`](/reference/react/Suspense)sınırına (boundary) sararak yapabilirsiniz:
76
77
77
78
```js {1,4}
78
79
<Suspense fallback={<Loading />}>
79
-
<h2>Preview</h2>
80
+
<h2>Ön İzleme</h2>
80
81
<MarkdownPreview />
81
82
</Suspense>
82
83
```
83
84
84
-
In this example, the code for `MarkdownPreview` won't be loaded until you attempt to render it. If `MarkdownPreview`hasn't loaded yet,`Loading`will be shown in its place. Try ticking the checkbox:
85
+
Bu örnekte, `MarkdownPreview`'ın kodu render edilene kadar yüklenmez. `MarkdownPreview`yüklenene kadar yerine`Loading`gösterilir. Onay kutusunu işaretlemeyi deneyin:
//Add a fixed delay so you can see the loading state
116
+
//Yükleniyor durumunu görebilmeniz için sabit bir gecikme ekleyin
116
117
functiondelayForDemo(promise) {
117
118
returnnewPromise(resolve=> {
118
119
setTimeout(resolve, 2000);
@@ -122,7 +123,7 @@ function delayForDemo(promise) {
122
123
123
124
```js Loading.js
124
125
exportdefaultfunctionLoading() {
125
-
return<p><i>Loading...</i></p>;
126
+
return<p><i>Yükleniyor...</i></p>;
126
127
}
127
128
```
128
129
@@ -175,34 +176,34 @@ body {
175
176
176
177
</Sandpack>
177
178
178
-
This demo loads with an artificial delay. The next time you untick and tick the checkbox, `Preview`will be cached, so there will be no loading state. To see the loading state again, click "Reset" on the sandbox.
179
+
Bu demo, yapay bir gecikmeyle yüklenir. Bileşen yüklendikten sonras işareti kaldırıp yeniden işaretlediğinizde `Preview`ön belleğe alındığı için yükleniyor durumu olmaz. Yükleniyor durumunu yeniden görmek isterseniz, sandbox'daki "Sıfırla" butonuna tıklayın.
179
180
180
-
[Learn more about managing loading states with Suspense.](/reference/react/Suspense)
181
+
[Suspense ile yükleniyor durumlarını yönetmek hakkında daha fazla bilgi edinin.](/reference/react/Suspense)
181
182
182
183
---
183
184
184
-
## Troubleshooting {/*troubleshooting*/}
185
+
## Sorun giderme {/*troubleshooting*/}
185
186
186
-
### My `lazy`component's state gets reset unexpectedly {/*my-lazy-components-state-gets-reset-unexpectedly*/}
187
+
### `lazy`bileşenimdeki state'ler beklenmedik şekilde sıfırlanıyor {/*my-lazy-components-state-gets-reset-unexpectedly*/}
187
188
188
-
Do not declare `lazy`components *inside* other components:
189
+
`lazy`bileşenleri diğer bileşenlerin *içerisinde* tanımlamayın:
189
190
190
191
```js {4-5}
191
192
import { lazy } from'react';
192
193
193
194
functionEditor() {
194
-
// 🔴 Bad: This will cause all state to be reset on re-renders
195
+
// 🔴 Kötü: Bu yeniden render'larda tüm state'lerin sıfırlanmasına neden olur
Copy file name to clipboardExpand all lines: src/content/reference/react/useId.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ const id = useId()
20
20
21
21
### `useId()` {/*useid*/}
22
22
23
-
Benzersiz bir kimlik oluşturmak için `useId`'yi bileşeninizin kök kapsamında çağırın:
23
+
Benzersiz bir kimlik oluşturmak için `useId`'yi bileşeninizin en üst kapsamında çağırın:
24
24
25
25
```js
26
26
import { useId } from'react';
@@ -36,13 +36,13 @@ function PasswordField() {
36
36
37
37
Herhangi bir parametre almaz.
38
38
39
-
#### Dönüş Değerleri {/*returns*/}
39
+
#### Dönüş değerleri {/*returns*/}
40
40
41
41
Çağrıldığı bileşene özel olarak her bir `useId` çağrısı için _karakter dizisi (string)_ tipinde benzersiz kimlik döner.
42
42
43
43
#### Uyarılar {/*caveats*/}
44
44
45
-
* `useId` bir Hook olduğundan, yalnızca **bileşeninizin kök kapsamında** ya da kendi Hook'larınızda çağırabilirsiniz. Döngülerin ve koşulların içinde çağıramazsınız. Eğer çağırmak zorunda kaldıysanız yeni bir bileşene çıkarın ve state'i ona taşıyın.
45
+
* `useId` bir Hook olduğundan, yalnızca **bileşeninizin en üst kapsamında** ya da kendi Hook'larınızda çağırabilirsiniz. Döngülerin ve koşulların içinde çağıramazsınız. Eğer çağırmak zorunda kaldıysanız yeni bir bileşene çıkarın ve state'i ona taşıyın.
46
46
47
47
* Liste elemanlarına **anahtar üretmek için kullanılmamalıdır**. [Anahtarlar elinizdeki veriden üretilmelidir.](/learn/rendering-lists#where-to-get-your-key)
48
48
@@ -58,7 +58,7 @@ Herhangi bir parametre almaz.
58
58
59
59
### Erişilebilirlik öznitelikleri için benzersiz kimlikler üretmek {/*generating-unique-ids-for-accessibility-attributes*/}
60
60
61
-
Bileşeninizin kök kapsamında benzersiz kimlikler üretmek için `useId`'yi çağırın:
61
+
Benzersiz kimlikler üretmek için bileşeninizin en üst kapsamında`useId`'yi çağırın:
0 commit comments