Skip to content

Commit 93dbadf

Browse files
committed
feat(createRoot): translation of the updated part of the page
1 parent 23b7173 commit 93dbadf

File tree

1 file changed

+69
-67
lines changed

1 file changed

+69
-67
lines changed

src/content/reference/react-dom/client/createRoot.md

Lines changed: 69 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ Tamamen React ile oluşturulmuş bir uygulama genellikle kök bileşeni için ya
4545
4646
* **opsiyonel** `options`: Bu React kökü için seçenekler içeren bir nesne.
4747
48-
* <CanaryBadge title="This feature is only available in the Canary channel" /> **optional** `onCaughtError`: Callback called when React catches an error in an Error Boundary. Called with the `error` caught by the Error Boundary, and an `errorInfo` object containing the `componentStack`.
49-
* <CanaryBadge title="This feature is only available in the Canary channel" /> **optional** `onUncaughtError`: Callback called when an error is thrown and not caught by an Error Boundary. Called with the `error` that was thrown, and an `errorInfo` object containing the `componentStack`.
50-
* **optional** `onRecoverableError`: React'in hatalardan otomatik olarak kurtulduğunda çağrılan callback fonksiyonu. Called with an `error` React throws, and an `errorInfo` object containing the `componentStack`. Some recoverable errors may include the original error cause as `error.cause`.
48+
* <CanaryBadge title="Bu özellik yalnızca Canary kanalında mevcuttur" /> **opsiyonel** `onCaughtError`: React bir Hata yakalayıcı bir hata yakaladığında callback yapılır. Hata yakalayıcı tarafından yakalanan `error` ve `componentStack` içeren bir `errorInfo` nesnesi ile çağrılır.
49+
* <CanaryBadge title="This feature is only available in the Canary channel" /> **opsiyonel** Bir hata fırlatıldığında ve bir Hata yakalayıcı tarafından yakalanmadığında callback yapılır. Atılan hata ve `componentStack`'i içeren bir `errorInfo` nesnesi ile çağrılır.
50+
* **opsiyonel** `onRecoverableError`: React'in hatalardan otomatik olarak kurtulduğunda çağrılan callback fonksiyonu. React'in attığı bir `error` ve `componentStack` içeren bir `errorInfo` nesnesi ile çağrılır. Bazı kurtarılabilir hatalar, `error.cause` olarak orijinal hata nedenini içerebilir.
5151
* **opsiyonel** `identifierPrefix`: [`useId`](/reference/react/useId) tarafından oluşturulan kimlikler için React'in kullandığı bir dize öneki. Aynı sayfada birden fazla kök kullanırken çakışmaları önlemek için kullanışlıdır.
5252
5353
@@ -345,15 +345,15 @@ export default function App({counter}) {
345345
346346
Birden fazla kez `render` çağrısı yapmak nadirdir. Genellikle bileşenleriniz bunun yerine [state güncellemesi](/reference/react/useState) yapacaktır.
347347
348-
### Show a dialog for uncaught errors {/*show-a-dialog-for-uncaught-errors*/}
348+
### Yakalanmamış hatalar için bir diyaloğu gösterme {/*show-a-dialog-for-uncaught-errors*/}
349349
350350
<Canary>
351351
352-
`onUncaughtError` is only available in the latest React Canary release.
352+
`onUncaughtError` sadece en son React Canary sürümünde mevcuttur.
353353
354354
</Canary>
355355
356-
By default, React will log all uncaught errors to the console. To implement your own error reporting, you can provide the optional `onUncaughtError` root option:
356+
Varsayılan olarak, React tüm yakalanmamış hataları konsola kaydeder. Kendi hata raporlamanızı uygulamak için, isteğe bağlı `onUncaughtError` root seçeneğini sağlayabilirsin:
357357
358358
```js [[1, 6, "onUncaughtError"], [2, 6, "error", 1], [3, 6, "errorInfo"], [4, 10, "componentStack"]]
359359
import { createRoot } from 'react-dom/client';
@@ -363,7 +363,7 @@ const root = createRoot(
363363
{
364364
onUncaughtError: (error, errorInfo) => {
365365
console.error(
366-
'Uncaught error',
366+
'Yakalanmamış hata',
367367
error,
368368
errorInfo.componentStack
369369
);
@@ -373,20 +373,21 @@ const root = createRoot(
373373
root.render(<App />);
374374
```
375375
376-
The <CodeStep step={1}>onUncaughtError</CodeStep> option is a function called with two arguments:
376+
<CodeStep step={1}>onUncaughtError</CodeStep> seçeneği iki bağımsız değişkenle çağrılan bir fonksiyondur:
377377
378-
1. The <CodeStep step={2}>error</CodeStep> that was thrown.
379-
2. An <CodeStep step={3}>errorInfo</CodeStep> object that contains the <CodeStep step={4}>componentStack</CodeStep> of the error.
378+
1. Fırlatılan <CodeStep step={2}>hata</CodeStep>.
380379
381-
You can use the `onUncaughtError` root option to display error dialogs:
380+
2. Hatanın <CodeStep step={4}>componentStack</CodeStep>'ini içeren bir <CodeStep step={3}>errorInfo</CodeStep> nesnesi.
381+
382+
Hata diyalog pencerelerini görüntülemek için `onUncaughtError` kök seçeneğini kullanabilirsin:
382383
383384
<Sandpack>
384385
385386
```html index.html hidden
386387
<!DOCTYPE html>
387388
<html>
388389
<head>
389-
<title>My app</title>
390+
<title>Benim uygulamam</title>
390391
</head>
391392
<body>
392393
<!--
@@ -401,12 +402,12 @@ You can use the `onUncaughtError` root option to display error dialogs:
401402
<p>
402403
<pre id="error-body"></pre>
403404
</p>
404-
<h4 class="-mb-20">This error occurred at:</h4>
405+
<h4 class="-mb-20">Meydana gelen hata:</h4>
405406
<pre id="error-component-stack" class="nowrap"></pre>
406-
<h4 class="mb-0">Call stack:</h4>
407+
<h4 class="mb-0">Çağrı yığını:</h4>
407408
<pre id="error-stack" class="nowrap"></pre>
408409
<div id="error-cause">
409-
<h4 class="mb-0">Caused by:</h4>
410+
<h4 class="mb-0">Sebep olan:</h4>
410411
<pre id="error-cause-message"></pre>
411412
<pre id="error-cause-stack" class="nowrap"></pre>
412413
</div>
@@ -417,7 +418,7 @@ You can use the `onUncaughtError` root option to display error dialogs:
417418
>
418419
Close
419420
</button>
420-
<h3 id="error-not-dismissible">This error is not dismissible.</h3>
421+
<h3 id="error-not-dismissible">Bu hata göz ardı edilemez.</h3>
421422
</div>
422423
<!-- This is the DOM node -->
423424
<div id="root"></div>
@@ -526,15 +527,15 @@ function reportError({ title, error, componentStack, dismissable }) {
526527
}
527528

528529
export function reportCaughtError({error, cause, componentStack}) {
529-
reportError({ title: "Caught Error", error, componentStack, dismissable: true});
530+
reportError({ title: "Yakalanan Hata", error, componentStack, dismissable: true});
530531
}
531532

532533
export function reportUncaughtError({error, cause, componentStack}) {
533-
reportError({ title: "Uncaught Error", error, componentStack, dismissable: false });
534+
reportError({ title: "Yakalanmamış Hata", error, componentStack, dismissable: false });
534535
}
535536

536537
export function reportRecoverableError({error, cause, componentStack}) {
537-
reportError({ title: "Recoverable Error", error, componentStack, dismissable: true });
538+
reportError({ title: "Kurtarılabilir Hata", error, componentStack, dismissable: true });
538539
}
539540
```
540541
@@ -570,9 +571,9 @@ export default function App() {
570571

571572
return (
572573
<div>
573-
<span>This error shows the error dialog:</span>
574+
<span>Bu hata, hata diyaloğunu gösterir:</span>
574575
<button onClick={() => setThrowError(true)}>
575-
Throw error
576+
Hata fırlat
576577
</button>
577578
</div>
578579
);
@@ -593,15 +594,15 @@ export default function App() {
593594
</Sandpack>
594595
595596
596-
### Displaying Error Boundary errors {/*displaying-error-boundary-errors*/}
597+
### Hata yakalayıcı ile ilgili hataları görüntüleme {/*displaying-error-boundary-errors*/}
597598
598599
<Canary>
599600
600-
`onCaughtError` is only available in the latest React Canary release.
601+
`onCaughtError` sadece en son React Canary sürümünde mevcuttur.
601602
602603
</Canary>
603604
604-
By default, React will log all errors caught by an Error Boundary to `console.error`. To override this behavior, you can provide the optional `onCaughtError` root option to handle errors caught by an [Error Boundary](/reference/react/Component#catching-rendering-errors-with-an-error-boundary):
605+
Varsayılan olarak, React bir Hata yakalayıcı tarafından yakalanan tüm hataları `console.error` dosyasına kaydeder. Bu davranışı geçersiz kılmak için, bir Hata yakalayıcı tarafından yakalanan hataları işlemek üzere isteğe bağlı `onCaughtError` kök seçeneğini sağlayabilirsin. [Hata yakalayıcı](/reference/react/Component#catching-rendering-errors-with-an-error-boundary):
605606
606607
```js [[1, 6, "onCaughtError"], [2, 6, "error", 1], [3, 6, "errorInfo"], [4, 10, "componentStack"]]
607608
import { createRoot } from 'react-dom/client';
@@ -611,7 +612,7 @@ const root = createRoot(
611612
{
612613
onCaughtError: (error, errorInfo) => {
613614
console.error(
614-
'Caught error',
615+
'Yakalanan hata',
615616
error,
616617
errorInfo.componentStack
617618
);
@@ -621,20 +622,20 @@ const root = createRoot(
621622
root.render(<App />);
622623
```
623624
624-
The <CodeStep step={1}>onCaughtError</CodeStep> option is a function called with two arguments:
625+
<CodeStep step={1}>onCaughtError</CodeStep> seçeneği iki bağımsız değişkenle çağrılan bir fonksiyondur:
625626
626-
1. The <CodeStep step={2}>error</CodeStep> that was caught by the boundary.
627-
2. An <CodeStep step={3}>errorInfo</CodeStep> object that contains the <CodeStep step={4}>componentStack</CodeStep> of the error.
627+
1. Hata yakalayıcı tarafından yakalanan <CodeStep step={2}>hata</CodeStep>.
628+
2. Hatanın <CodeStep step={4}>componentStack</CodeStep>'ini içeren bir <CodeStep step={3}>errorInfo</CodeStep> nesnesi.
628629
629-
You can use the `onCaughtError` root option to display error dialogs or filter known errors from logging:
630+
Hata diyologlarını görüntülemek veya bilinen hataları günlükten filtrelemek için `onCaughtError` kök seçeneğini kullanabilirsin:
630631
631632
<Sandpack>
632633
633634
```html index.html hidden
634635
<!DOCTYPE html>
635636
<html>
636637
<head>
637-
<title>My app</title>
638+
<title>Benim uygulamam</title>
638639
</head>
639640
<body>
640641
<!--
@@ -649,12 +650,12 @@ You can use the `onCaughtError` root option to display error dialogs or filter k
649650
<p>
650651
<pre id="error-body"></pre>
651652
</p>
652-
<h4 class="-mb-20">This error occurred at:</h4>
653+
<h4 class="-mb-20">Meydana gelen hata:</h4>
653654
<pre id="error-component-stack" class="nowrap"></pre>
654-
<h4 class="mb-0">Call stack:</h4>
655+
<h4 class="mb-0">Çağrı yığını:</h4>
655656
<pre id="error-stack" class="nowrap"></pre>
656657
<div id="error-cause">
657-
<h4 class="mb-0">Caused by:</h4>
658+
<h4 class="mb-0">Sebep olan:</h4>
658659
<pre id="error-cause-message"></pre>
659660
<pre id="error-cause-stack" class="nowrap"></pre>
660661
</div>
@@ -665,7 +666,7 @@ You can use the `onCaughtError` root option to display error dialogs or filter k
665666
>
666667
Close
667668
</button>
668-
<h3 id="error-not-dismissible">This error is not dismissible.</h3>
669+
<h3 id="error-not-dismissible">Bu hata göz ardı edilemez.</h3>
669670
</div>
670671
<!-- This is the DOM node -->
671672
<div id="root"></div>
@@ -774,15 +775,15 @@ function reportError({ title, error, componentStack, dismissable }) {
774775
}
775776

776777
export function reportCaughtError({error, cause, componentStack}) {
777-
reportError({ title: "Caught Error", error, componentStack, dismissable: true});
778+
reportError({ title: "Yakalanan Hata", error, componentStack, dismissable: true});
778779
}
779780

780781
export function reportUncaughtError({error, cause, componentStack}) {
781-
reportError({ title: "Uncaught Error", error, componentStack, dismissable: false });
782+
reportError({ title: "Yakalanmamış Hata", error, componentStack, dismissable: false });
782783
}
783784

784785
export function reportRecoverableError({error, cause, componentStack}) {
785-
reportError({ title: "Recoverable Error", error, componentStack, dismissable: true });
786+
reportError({ title: "Kurtarılabilir Hata", error, componentStack, dismissable: true });
786787
}
787788
```
788789
@@ -830,13 +831,13 @@ export default function App() {
830831
}}
831832
>
832833
{error != null && <Throw error={error} />}
833-
<span>This error will not show the error dialog:</span>
834+
<span>Bu hata, hata diyaloğunu göstermeyecektir:</span>
834835
<button onClick={handleKnown}>
835-
Throw known error
836+
Bilinen hatayı fırlat
836837
</button>
837-
<span>This error will show the error dialog:</span>
838+
<span>Bu hata, hata diyoloğunu gösterecektir:</span>
838839
<button onClick={handleUnknown}>
839-
Throw unknown error
840+
Bilinmeyen bir hata fırlat
840841
</button>
841842
</ErrorBoundary>
842843

@@ -847,9 +848,9 @@ export default function App() {
847848
function fallbackRender({ resetErrorBoundary }) {
848849
return (
849850
<div role="alert">
850-
<h3>Error Boundary</h3>
851-
<p>Something went wrong.</p>
852-
<button onClick={resetErrorBoundary}>Reset</button>
851+
<h3>Hata Yakalayıcı</h3>
852+
<p>Bir şeyler ters gitti.</p>
853+
<button onClick={resetErrorBoundary}>Sıfırla</button>
853854
</div>
854855
);
855856
}
@@ -877,9 +878,9 @@ function Throw({error}) {
877878
878879
</Sandpack>
879880
880-
### Displaying a dialog for recoverable errors {/*displaying-a-dialog-for-recoverable-errors*/}
881+
### Kurtarılabilir hatalar için bir diyoloğu görüntüleme {/*displaying-a-dialog-for-recoverable-errors*/}
881882
882-
React may automatically render a component a second time to attempt to recover from an error thrown in render. If successful, React will log a recoverable error to the console to notify the developer. To override this behavior, you can provide the optional `onRecoverableError` root option:
883+
React, render etme sırasında atılan bir hatadan kurtulmayı denemek için bir bileşeni otomatik olarak ikinci kez render edebilir. Başarılı olursa, React geliştiriciyi bilgilendirmek için konsola kurtarılabilir bir hata günlüğü kaydeder. Bu davranışı geçersiz kılmak için, isteğe bağlı `onRecoverableError` kök seçeneğini sağlayabilirsin:
883884
884885
```js [[1, 6, "onRecoverableError"], [2, 6, "error", 1], [3, 10, "error.cause"], [4, 6, "errorInfo"], [5, 11, "componentStack"]]
885886
import { createRoot } from 'react-dom/client';
@@ -889,7 +890,7 @@ const root = createRoot(
889890
{
890891
onRecoverableError: (error, errorInfo) => {
891892
console.error(
892-
'Recoverable error',
893+
'Kurtarılabilir hata',
893894
error,
894895
error.cause,
895896
errorInfo.componentStack,
@@ -900,20 +901,21 @@ const root = createRoot(
900901
root.render(<App />);
901902
```
902903
903-
The <CodeStep step={1}>onRecoverableError</CodeStep> option is a function called with two arguments:
904+
<CodeStep step={1}>onRecoverableError</CodeStep> seçeneği iki bağımsız değişkenle çağrılan bir fonksiyondur:
905+
906+
1. React'in fırlattığı <CodeStep step={2}>hata</CodeStep>. Bazı hatalar, <CodeStep step={3}>error.cause</CodeStep> olarak orijinal nedeni içerebilir.
904907
905-
1. The <CodeStep step={2}>error</CodeStep> that React throws. Some errors may include the original cause as <CodeStep step={3}>error.cause</CodeStep>.
906-
2. An <CodeStep step={4}>errorInfo</CodeStep> object that contains the <CodeStep step={5}>componentStack</CodeStep> of the error.
908+
2. Hatanın <CodeStep step={5}>componentStack</CodeStep>'ini içeren bir <CodeStep step={4}>errorInfo</CodeStep> nesnesi.
907909
908-
You can use the `onRecoverableError` root option to display error dialogs:
910+
Hata diyaloglarını görüntülemek için `onRecoverableError` kök seçeneğini kullanabilirsin:
909911
910912
<Sandpack>
911913
912914
```html index.html hidden
913915
<!DOCTYPE html>
914916
<html>
915917
<head>
916-
<title>My app</title>
918+
<title>Benim uygulamam</title>
917919
</head>
918920
<body>
919921
<!--
@@ -928,12 +930,12 @@ You can use the `onRecoverableError` root option to display error dialogs:
928930
<p>
929931
<pre id="error-body"></pre>
930932
</p>
931-
<h4 class="-mb-20">This error occurred at:</h4>
933+
<h4 class="-mb-20">Meydana gelen hata:</h4>
932934
<pre id="error-component-stack" class="nowrap"></pre>
933-
<h4 class="mb-0">Call stack:</h4>
935+
<h4 class="mb-0">Çağrı yığını:</h4>
934936
<pre id="error-stack" class="nowrap"></pre>
935937
<div id="error-cause">
936-
<h4 class="mb-0">Caused by:</h4>
938+
<h4 class="mb-0">Sebep olan:</h4>
937939
<pre id="error-cause-message"></pre>
938940
<pre id="error-cause-stack" class="nowrap"></pre>
939941
</div>
@@ -944,7 +946,7 @@ You can use the `onRecoverableError` root option to display error dialogs:
944946
>
945947
Close
946948
</button>
947-
<h3 id="error-not-dismissible">This error is not dismissible.</h3>
949+
<h3 id="error-not-dismissible">Bu hata göz ardı edilemez.</h3>
948950
</div>
949951
<!-- This is the DOM node -->
950952
<div id="root"></div>
@@ -1053,15 +1055,15 @@ function reportError({ title, error, componentStack, dismissable }) {
10531055
}
10541056

10551057
export function reportCaughtError({error, cause, componentStack}) {
1056-
reportError({ title: "Caught Error", error, componentStack, dismissable: true});
1058+
reportError({ title: "Yakalanan Hata", error, componentStack, dismissable: true});
10571059
}
10581060

10591061
export function reportUncaughtError({error, cause, componentStack}) {
1060-
reportError({ title: "Uncaught Error", error, componentStack, dismissable: false });
1062+
reportError({ title: "Yakalanmamış Hata", error, componentStack, dismissable: false });
10611063
}
10621064

10631065
export function reportRecoverableError({error, cause, componentStack}) {
1064-
reportError({ title: "Recoverable Error", error, componentStack, dismissable: true });
1066+
reportError({ title: "Kurtarılabilir Hata", error, componentStack, dismissable: true });
10651067
}
10661068
```
10671069
@@ -1097,8 +1099,8 @@ export default function App() {
10971099
fallbackRender={fallbackRender}
10981100
>
10991101
{!errorThrown && <Throw />}
1100-
<p>This component threw an error, but recovered during a second render.</p>
1101-
<p>Since it recovered, no Error Boundary was shown, but <code>onRecoverableError</code> was used to show an error dialog.</p>
1102+
<p>Bu bileşen bir hata fırlattı, ancak ikinci bir render etme sırasında düzeldi.</p>
1103+
<p>Kurtarıldığı için Hata yakalayıcı gösterilmedi, ancak bir hata diyoloğu göstermek için <code>onRecoverableError</code> kullanıldı.</p>
11021104
</ErrorBoundary>
11031105

11041106
</>
@@ -1108,8 +1110,8 @@ export default function App() {
11081110
function fallbackRender() {
11091111
return (
11101112
<div role="alert">
1111-
<h3>Error Boundary</h3>
1112-
<p>Something went wrong.</p>
1113+
<h3>Hata Yakalayıcı</h3>
1114+
<p>Bir şeyler ters gitti.</p>
11131115
</div>
11141116
);
11151117
}
@@ -1155,17 +1157,17 @@ Bunu yapana kadar hiçbir şey görüntülenmez.
11551157
11561158
---
11571159
1158-
### I'm getting an error: "You passed a second argument to root.render" {/*im-getting-an-error-you-passed-a-second-argument-to-root-render*/}
1160+
### Bir hata alıyorum: "root.render'a ikinci bir argüman geçtiniz" {/*im-getting-an-error-you-passed-a-second-argument-to-root-render*/}
11591161
1160-
A common mistake is to pass the options for `createRoot` to `root.render(...)`:
1162+
Sık yapılan bir hata, `createRoot` seçeneklerini `root.render(...)` öğesine aktarmaktır:
11611163
11621164
<ConsoleBlock level="error">
11631165
1164-
Warning: You passed a second argument to root.render(...) but it only accepts one argument.
1166+
Uyarı: root.render(...) öğesine ikinci bir bağımsız değişken ilettiniz, ancak bu öğe yalnızca bir bağımsız değişken kabul eder.
11651167
11661168
</ConsoleBlock>
11671169
1168-
To fix, pass the root options to `createRoot(...)`, not `root.render(...)`:
1170+
Düzeltmek için, kök seçeneklerini `root.render(...)` yerine `createRoot(...)` öğesine aktarın:
11691171
```js {2,5}
11701172
// 🚩 Wrong: root.render only takes one argument.
11711173
root.render(App, {onUncaughtError});

0 commit comments

Comments
 (0)