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
Copy file name to clipboardExpand all lines: src/content/reference/react/Fragment.md
+27-39Lines changed: 27 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,9 @@ title: <Fragment> (<>...</>)
4
4
5
5
<Intro>
6
6
7
-
<<<<<<< HEAD
8
-
`<Fragment>`, genellikle `<>...</>` sözdizimiyle birlikte kullanılır ve bir kaplayıcı düğüm olmadan elemanları gruplamaya olanak tanır.
9
-
=======
10
-
`<Fragment>`, often used via `<>...</>` syntax, lets you group elements without a wrapper node.
7
+
`<Fragment>`, genellikle `<>...</>` sözdizimiyle kullanılır, öğeleri sarmalayıcı bir düğüm olmadan gruplamanı sağlar.
11
8
12
-
<Experimental> Fragments can also accept refs, which enable interacting with underlying DOM nodes without adding wrapper elements. See reference and usage below.</Experimental>
13
-
>>>>>>> 11cb6b591571caf5fa2a192117b6a6445c3f2027
9
+
<Experimental> Fragment'ler ayrıca ref'leri de kabul edebilir, bu da sarmalayıcı öğe eklemeden alt DOM düğümleriyle etkileşimde bulunmanı sağlar. Aşağıda referans ve kullanım örneklerini görebilirsin.</Experimental>
14
10
15
11
```js
16
12
<>
@@ -33,38 +29,34 @@ Tek bir elemana ihtiyaç duyduğunuz durumlarda, elemanları `<Fragment>` içine
33
29
34
30
#### Prop'lar {/*props*/}
35
31
36
-
<<<<<<< HEAD
37
-
**isteğe bağlı**`anahtar`: Açık `<Fragment>` sözdizimiyle tanımlanan Fragment'ler [anahtara](/learn/rendering-lists#keeping-list-items-in-order-with-key) sahip olabilir.
38
-
=======
39
-
-**optional**`key`: Fragments declared with the explicit `<Fragment>` syntax may have [keys.](/learn/rendering-lists#keeping-list-items-in-order-with-key)
40
-
- <ExperimentalBadge /> **optional**`ref`: A ref object (e.g. from [`useRef`](/reference/react/useRef)) or [callback function](/reference/react-dom/components/common#ref-callback). React provides a `FragmentInstance` as the ref value that implements methods for interacting with the DOM nodes wrapped by the Fragment.
32
+
-**optional**`key`: Açık `<Fragment>` sözdizimi ile tanımlanan Fragment'ler [key] alabilir. (/learn/rendering-lists#keeping-list-items-in-order-with-key)
33
+
- <ExperimentalBadge /> **optional**`ref`: Bir ref objesi (ör. [`useRef`](/reference/react/useRef) kullanılarak) veya [callback function](/reference/react-dom/components/common#ref-callback). React, Fragment tarafından sarılan DOM düğümleriyle etkileşim için yöntemler sunan bir `FragmentInstance` sağlar.
When you pass a ref to a fragment, React provides a `FragmentInstance` object with methods for interacting with the DOM nodes wrapped by the fragment:
37
+
Fragment'e bir ref verdiğinde, React Fragment tarafından sarılan DOM düğümleriyle etkileşim için yöntemler içeren bir `FragmentInstance` nesnesi sağlar:
45
38
46
-
**Event handling methods:**
47
-
-`addEventListener(type, listener, options?)`: Adds an event listener to all first-level DOM children of the Fragment.
48
-
-`removeEventListener(type, listener, options?)`: Removes an event listener from all first-level DOM children of the Fragment.
49
-
-`dispatchEvent(event)`: Dispatches an event to a virtual child of the Fragment to call any added listeners and can bubble to the DOM parent.
39
+
**Olay yönetimi yöntemleri:**
40
+
-`addEventListener(type, listener, options?)`: Fragment'in tüm birinci seviyedeki DOM çocuklarına bir olay dinleyici ekler.
41
+
-`removeEventListener(type, listener, options?)`: Fragment'in tüm birinci seviyedeki DOM çocuklarından bir olay dinleyici kaldırır.
42
+
-`dispatchEvent(event)`: Fragment'in sanal bir çocuğuna bir olay gönderir; eklenen dinleyicileri çağırır ve DOM üstüne kabarcık yapabilir.
50
43
51
-
**Layout methods:**
52
-
-`compareDocumentPosition(otherNode)`: Compares the document position of the Fragment with another node.
53
-
-If the Fragment has children, the native `compareDocumentPosition`value is returned.
54
-
-Empty Fragments will attempt to compare positioning within the React tree and include `Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC`.
55
-
-Elements that have a different relationship in the React tree and DOM tree due to portaling or other insertions are `Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC`.
56
-
-`getClientRects()`: Returns a flat array of `DOMRect`objects representing the bounding rectangles of all children.
57
-
-`getRootNode()`: Returns the root node containing the Fragment's parent DOM node.
44
+
**Düzen (layout) yöntemleri:**
45
+
-`compareDocumentPosition(otherNode)`: Fragment'in belge konumunu başka bir düğümle karşılaştırır.
46
+
- Fragment çocuklara sahipse, native `compareDocumentPosition`değeri döndürülür.
47
+
-Boş Fragment'ler, React ağacı içindeki konumu karşılaştırmayı dener ve `Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC` içerir.
48
+
-React ağacı ile DOM ağacı arasında portaling veya diğer eklemeler nedeniyle farklı ilişkiye sahip öğeler `Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC` olur.
49
+
-`getClientRects()`: Tüm çocukların sınır dikdörtgenlerini temsil eden düz bir `DOMRect`dizisi döndürür.
50
+
-`getRootNode()`: Fragment'in üst DOM düğümünü içeren kök düğümü döndürür.
58
51
59
-
**Focus management methods:**
60
-
-`focus(options?)`: Focuses the first focusable DOM node in the Fragment. Focus is attempted on nested children depth-first.
61
-
-`focusLast(options?)`: Focuses the last focusable DOM node in the Fragment. Focus is attempted on nested children depth-first.
62
-
-`blur()`: Removes focus if `document.activeElement`is within the Fragment.
52
+
**Odak (focus) yönetimi yöntemleri:**
53
+
-`focus(options?)`: Fragment'teki ilk odaklanabilir DOM düğümünü odaklar. Odak derinlemesine, çocuklar üzerinde denenir.
54
+
-`focusLast(options?)`: Fragment'teki son odaklanabilir DOM düğümünü odaklar. Odak derinlemesine, çocuklar üzerinde denenir.
55
+
-`blur()`: Eğer `document.activeElement`Fragment içindeyse odak kaldırılır.
63
56
64
-
**Observer methods:**
65
-
-`observeUsing(observer)`: Starts observing the Fragment's DOM children with an IntersectionObserver or ResizeObserver.
66
-
-`unobserveUsing(observer)`: Stops observing the Fragment's DOM children with the specified observer.
67
-
>>>>>>> 11cb6b591571caf5fa2a192117b6a6445c3f2027
57
+
**Gözlemleme (observer) yöntemleri:**
58
+
-`observeUsing(observer)`: Fragment'in DOM çocuklarını bir `IntersectionObserver` veya `ResizeObserver` ile gözlemlemeye başlar.
59
+
-`unobserveUsing(observer)`: Belirtilen observer ile Fragment'in DOM çocuklarını gözlemlemeyi durdurur.
68
60
69
61
#### Uyarılar {/*caveats*/}
70
62
@@ -248,16 +240,13 @@ function PostBody({ body }) {
248
240
}
249
241
```
250
242
251
-
<<<<<<< HEAD
252
-
</Sandpack>
253
-
=======
254
243
</Sandpack>
255
244
256
245
---
257
246
258
-
### <ExperimentalBadge /> Using Fragment refs for DOM interaction {/*using-fragment-refs-for-dom-interaction*/}
247
+
### <ExperimentalBadge /> Fragment ref'lerini DOM etkileşimi için kullanma {/*using-fragment-refs-for-dom-interaction*/}
259
248
260
-
Fragment refs allow you to interact with the DOM nodes wrapped by a Fragment without adding extra wrapper elements. This is useful for event handling, visibility tracking, focus management, and replacing deprecated patterns like `ReactDOM.findDOMNode()`.
249
+
Fragment ref'leri, ekstra sarmalayıcı öğe eklemeden Fragment tarafından sarılan DOM düğümleriyle etkileşimde bulunmanı sağlar. Bu, olay yönetimi, görünürlük takibi, odak yönetimi ve `ReactDOM.findDOMNode()` gibi kullanım dışı kalmış desenlerin yerine geçmek için faydalıdır.
261
250
262
251
```js
263
252
import { Fragment } from'react';
@@ -275,9 +264,9 @@ function ClickableFragment({ children, onClick }) {
275
264
```
276
265
---
277
266
278
-
### <ExperimentalBadge /> Tracking visibility with Fragment refs {/*tracking-visibility-with-fragment-refs*/}
267
+
### <ExperimentalBadge /> Fragment ref'leri ile görünürlüğü izleme {/*tracking-visibility-with-fragment-refs*/}
279
268
280
-
Fragment refs are useful for visibility tracking and intersection observation. This enables you to monitor when content becomes visible without requiring the child Components to expose refs:
269
+
Fragment ref'leri, görünürlük takibi ve intersection gözlemi için faydalıdır. Bu sayede, alt Component'ların ref açığa çıkarmasına gerek kalmadan içeriğin ne zaman görünür hale geldiğini izleyebilirsin:
0 commit comments