Skip to content

Commit cbab2df

Browse files
committed
Fragment.md
1 parent 0f52d19 commit cbab2df

File tree

1 file changed

+27
-39
lines changed

1 file changed

+27
-39
lines changed

src/content/reference/react/Fragment.md

Lines changed: 27 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@ title: <Fragment> (<>...</>)
44

55
<Intro>
66

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.
118

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>
1410

1511
```js
1612
<>
@@ -33,38 +29,34 @@ Tek bir elemana ihtiyaç duyduğunuz durumlarda, elemanları `<Fragment>` içine
3329

3430
#### Prop'lar {/*props*/}
3531

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.
4134

4235
### <ExperimentalBadge /> FragmentInstance {/*fragmentinstance*/}
4336

44-
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:
4538

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.
5043

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.
5851

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.
6356

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.
6860

6961
#### Uyarılar {/*caveats*/}
7062

@@ -248,16 +240,13 @@ function PostBody({ body }) {
248240
}
249241
```
250242
251-
<<<<<<< HEAD
252-
</Sandpack>
253-
=======
254243
</Sandpack>
255244
256245
---
257246
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*/}
259248
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.
261250
262251
```js
263252
import { Fragment } from 'react';
@@ -275,9 +264,9 @@ function ClickableFragment({ children, onClick }) {
275264
```
276265
---
277266
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*/}
279268
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:
281270
282271
```js {19,21,31-34}
283272
import { Fragment, useRef, useLayoutEffect } from 'react';
@@ -341,4 +330,3 @@ function FocusFragment({ children }) {
341330
```
342331
343332
The `focus()` method focuses the first focusable element within the Fragment, while `focusLast()` focuses the last focusable element.
344-
>>>>>>> 11cb6b591571caf5fa2a192117b6a6445c3f2027

0 commit comments

Comments
 (0)