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-dom/render.md
+39-40Lines changed: 39 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,15 @@ title: render
4
4
5
5
<Deprecated>
6
6
7
-
This API will be removed in a future major version of React.
7
+
Bu API, React'in gelecekteki bir ana sürümünde kaldırılacaktır.
8
8
9
-
In React 18,`render` was replaced by [`createRoot`.](/reference/react-dom/client/createRoot)Using `render` in React 18 will warn that your app will behave as if it’s running React 17. Learn more [here.](/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis)
9
+
React 18'de`render`, [`createRoot`](/reference/react-dom/client/createRoot)ile değiştirilmiştir. React 18'de `render` kullanmak, uygulamanızın React 17 gibi davranacağı uyarısını verecektir. Daha fazla bilgi için [buraya](/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis) bakınız.
10
10
11
11
</Deprecated>
12
12
13
13
<Intro>
14
14
15
-
`render` renders a piece of [JSX](/learn/writing-markup-with-jsx) ("React node") into a browser DOM node.
15
+
`render`, bir [JSX](/learn/writing-markup-with-jsx) ("React düğümü") parçasını tarayıcı DOM düğümüne render eder.
React will display `<App />`in the `domNode`, and take over managing the DOM inside it.
40
+
React, `<App />`bileşenini `domNode` içinde görüntüleyecek ve içindeki DOM'u yönetmeye başlayacaktır.
41
41
42
-
An app fully built with React will usually only have one `render`call with its root component. A page that uses "sprinkles" of React for parts of the page may have as many `render`calls as needed.
42
+
Tamamen React ile oluşturulmuş bir uygulama genellikle sadece bir `render`çağrısıyla kök (root) bileşene sahip olur. Sayfanın bazı bölümleri için React "sprinkles" (serpme) kullanılan bir sayfada, ihtiyaç duyulan kadar çok `render`çağrısı bulunabilir.
43
43
44
-
[See more examples below.](#usage)
44
+
[Daha fazla örnek için aşağıya bakın.](#usage)
45
45
46
-
#### Parameters {/*parameters*/}
46
+
#### Parametreler {/*parameters*/}
47
47
48
-
* `reactNode`: A *React node* that you want to display. This will usually be a piece of JSX like `<App />`, but you can also pass a React element constructed with [`createElement()`](/reference/react/createElement), a string, a number, `null`, or`undefined`.
48
+
* `reactNode`: Görüntülemek istediğiniz *React düğümü*. Bu genellikle `<App />` gibi bir JSX parçası olacaktır; ancak bir React elemanını [`createElement()`](/reference/react/createElement) ile oluşturabilir, bir dize, bir sayı, `null` veya`undefined` de geçirebilirsiniz.
49
49
50
-
* `domNode`: A [DOM element.](https://developer.mozilla.org/en-US/docs/Web/API/Element) React will display the `reactNode` you pass inside this DOM element. From this moment, React will manage the DOM inside the `domNode`and update it when your React tree changes.
50
+
* `domNode`: [DOM elemanı.](https://developer.mozilla.org/en-US/docs/Web/API/Element) React, verdiğiniz `reactNode`'u bu DOM elemanının içinde gösterecektir. Bu andan itibaren, React `domNode`içindeki DOM'u yönetir ve React ağacınız (React tree) değiştiğinde güncellenir.
51
51
52
-
* **optional** `callback`: A function. If passed, React will call it after your component is placed into the DOM.
52
+
* **optional** `callback`: Fonksiyon. Geçilirse, React bileşeniniz DOM'a yerleştirildikten sonra bu fonksiyon çağrılır.
53
53
54
+
#### Dönüş değerleri {/*returns*/}
54
55
55
-
#### Returns {/*returns*/}
56
+
`render` genellikle `null` döndürür. Ancak, verdiğiniz `reactNode` bir *sınıf bileşeni* ise, bu durumda bileşenin bir örneğini döndürecektir.
56
57
57
-
`render` usually returns `null`. However, if the `reactNode` you pass is a *class component*, then it will return an instance of that component.
58
+
#### Dikkat edilmesi gerekenler {/*caveats*/}
58
59
59
-
#### Caveats {/*caveats*/}
60
+
* React 18'de `render`, [`createRoot`](/reference/react-dom/client/createRoot) ile değiştirilmiştir. Lütfen React 18 ve sonrası için `createRoot` kullanınız.
60
61
61
-
* In React 18, `render` was replaced by [`createRoot`.](/reference/react-dom/client/createRoot) Please use `createRoot` for React 18 and beyond.
62
+
* İlk `render` çağrısında, React, React bileşenini render etmek için `domNode` içindeki tüm mevcut HTML içeriğini siler. Eğer `domNode`'unuz, sunucu ya da derleme sürecinde React tarafından oluşturulan HTML içeriyorsa, mevcut HTML'e olay yöneticilerini (event handler) ekleyen [`hydrate()`](/reference/react-dom/hydrate) fonksiyonunu kullanınız.
62
63
63
-
* The first time you call `render`, React will clear all the existing HTML content inside the `domNode` before rendering the React component into it. If your `domNode` contains HTML generated by React on the server or during the build, use [`hydrate()`](/reference/react-dom/hydrate) instead, which attaches the event handlers to the existing HTML.
64
+
* Eğer aynı `domNode` üzerinde birden fazla `render` çağrısı yaparsanız, React, verdiğiniz son JSX'i yansıtmak için gerektiğinde DOM'u güncelleyecektir. React, DOM'un hangi kısımlarının yeniden kullanılabileceğine ve hangilerinin önceki ağaç (tree) ile ["eşleştirilerek"](/learn/preserving-and-resetting-state) yeniden oluşturulması gerektiğine karar verir. Aynı `domNode` üzerinde `render` çağrısı yapmak, kök bileşen (root component) üzerinde [`set` fonksiyonunu](/reference/react/useState#setstate) çağırmaya benzer: React gereksiz DOM güncellemelerinden kaçınır.
64
65
65
-
* If you call `render` on the same `domNode` more than once, React will update the DOM as necessary to reflect the latest JSX you passed. React will decide which parts of the DOM can be reused and which need to be recreated by ["matching it up"](/learn/preserving-and-resetting-state) with the previously rendered tree. Calling `render` on the same `domNode` again is similar to calling the [`set` function](/reference/react/useState#setstate) on the root component: React avoids unnecessary DOM updates.
66
-
67
-
* If your app is fully built with React, you'll likely have only one `render` call in your app. (If you use a framework, it might do this call for you.) When you want to render a piece of JSX in a different part of the DOM tree that isn't a child of your component (for example, a modal or a tooltip), use [`createPortal`](/reference/react-dom/createPortal) instead of `render`.
66
+
* Eğer uygulamanız tamamen React ile oluşturulmuşsa, uygulamanızda muhtemelen yalnızca bir `render` çağrısı olacaktır. (Bir çatı (framework) kullanıyorsanız, bunu sizin için yapabilir.) JSX'in bir parçasını bileşeninizin bir alt elemanı (child component) olmayan DOM ağacının farklı bir yerinde görüntülemek istediğinizde (örneğin, bir modal veya bir tooltip), `render` yerine [`createPortal`](/reference/react-dom/createPortal) kullanınız.
68
67
69
68
---
70
69
71
-
## Usage {/*usage*/}
70
+
## Kullanım {/*usage*/}
72
71
73
-
Call `render` to display a <CodeStep step={1}>React component</CodeStep> inside a <CodeStep step={2}>browser DOM node</CodeStep>.
72
+
Bir <CodeStep step={1}>React bileşenini</CodeStep> bir <CodeStep step={2}>tarayıcı DOM düğümünde</CodeStep> görüntülemek için `render`'ı çağırın.
### Rendering the root component {/*rendering-the-root-component*/}
81
+
### Kök bileşeni render etmek {/*rendering-the-root-component*/}
83
82
84
-
In apps fully built with React, **you will usually only do this once at startup**--to render the "root" component.
83
+
Tamamen React ile oluşturulmuş uygulamalarda, **genellikle bunu sadece başlangıçta bir kez yaparsınız** - "kök" bileşenini (root component) render etmek için.
Usually you shouldn't need to call `render` again or to call it in more places. From this point on, React will be managing the DOM of your application. To update the UI, your components will [use state.](/reference/react/useState)
103
+
Genellikle `render`'ı tekrar çağırmanıza veya başka yerlere çağırmanıza gerek yoktur. Bu noktadan itibaren, React uygulamanızın DOM'unu yönetmeye başlar. Kullanıcı arayüzünü güncellemek için bileşenleriniz [state](/reference/react/useState) kullanır.
### Birden çok kök oluşturma {/*rendering-multiple-roots*/}
109
108
110
-
If your page [isn't fully built with React](/learn/add-react-to-an-existing-project#using-react-for-a-part-of-your-existing-page), call `render` for each top-level piece of UI managed by React.
109
+
Eğer sayfanız [tamamen React ile oluşturulmamışsa](/learn/add-react-to-an-existing-project#using-react-for-a-part-of-your-existing-page), React tarafından yönetilen her bir üst düzey kullanıcı arayüzü (UI) parçası için `render`'ı çağırınız.
111
110
112
111
<Sandpack>
113
112
114
113
```html public/index.html
115
114
<nav id="navigation"></nav>
116
115
<main>
117
-
<p>This paragraph is not rendered by React (open index.htmlto verify).</p>
116
+
<p>Bu paragraf React tarafından render edilmiyor (doğrulamak içinindex.htmldosyasını açın).</p>
118
117
<section id="comments"></section>
119
118
</main>
120
119
```
@@ -139,8 +138,8 @@ render(
139
138
exportfunctionNavigation() {
140
139
return (
141
140
<ul>
142
-
<NavLink href="/">Home</NavLink>
143
-
<NavLink href="/about">About</NavLink>
141
+
<NavLink href="/">Anasayfa</NavLink>
142
+
<NavLink href="/about">Hakkında</NavLink>
144
143
</ul>
145
144
);
146
145
}
@@ -156,9 +155,9 @@ function NavLink({ href, children }) {
156
155
exportfunctionComments() {
157
156
return (
158
157
<>
159
-
<h2>Comments</h2>
160
-
<Comment text="Hello!" author="Sophie"/>
161
-
<Comment text="How are you?" author="Sunil"/>
158
+
<h2>Yorumlar</h2>
159
+
<Comment text="Merhaba!" author="Gökçe"/>
160
+
<Comment text="Nasılsın?" author="Burak"/>
162
161
</>
163
162
);
164
163
}
@@ -177,13 +176,13 @@ nav ul li { display: inline-block; margin-right: 20px; }
177
176
178
177
</Sandpack>
179
178
180
-
You can destroy the rendered trees with [`unmountComponentAtNode()`.](/reference/react-dom/unmountComponentAtNode)
179
+
Render edilmiş ağaçları (trees) [`unmountComponentAtNode()`](/reference/react-dom/unmountComponentAtNode) ile yok edebilirsiniz.
181
180
182
181
---
183
182
184
-
### Updating the rendered tree {/*updating-the-rendered-tree*/}
183
+
### Render edilmiş ağaçları güncelleme {/*updating-the-rendered-tree*/}
185
184
186
-
You can call`render`more than once on the same DOM node. As long as the component tree structure matches up with what was previously rendered, React will [preserve the state.](/learn/preserving-and-resetting-state) Notice how you can type in the input, which means that the updates from repeated `render`calls every second are not destructive:
185
+
Aynı DOM düğümünde`render`fonksiyonunu birden fazla kez çağırabilirsiniz. Bileşen ağacının yapısı önceden oluşturulanla eşleştiği sürece, React [durumu korur](/learn/preserving-and-resetting-state). Giriş alanına yazı yazabilmeniz, her saniyede tekrarlanan `render`çağrılarının yıkıcı(destructive) olmadığını gösterir:
187
186
188
187
<Sandpack>
189
188
@@ -206,13 +205,13 @@ setInterval(() => {
206
205
exportdefaultfunctionApp({counter}) {
207
206
return (
208
207
<>
209
-
<h1>Hello, world! {counter}</h1>
210
-
<input placeholder="Type something here"/>
208
+
<h1>Merhaba Dünya! {counter}</h1>
209
+
<input placeholder="Buraya bir şey yazın"/>
211
210
</>
212
211
);
213
212
}
214
213
```
215
214
216
215
</Sandpack>
217
216
218
-
It is uncommon to call`render`multiple times. Usually, you'll [update state](/reference/react/useState) inside your components instead.
217
+
Bu şekilde birden fazla kez`render`çağırmak nadiren gerçekleşir. Genellikle, bunun yerine bileşenlerinizin (component) içinde [state'i güncellersiniz.](/reference/react/useState)
0 commit comments