Skip to content

Commit 532a3de

Browse files
committed
translate createRef page
1 parent 5449e2b commit 532a3de

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/content/reference/react/createRef.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ class MyComponent extends Component {
6060
6161
---
6262
63-
## Usage {/*usage*/}
63+
## Kullanım {/*usage*/}
6464
65-
### Declaring a ref in a class component {/*declaring-a-ref-in-a-class-component*/}
65+
### Bir sınıf bileşeninde ref bildirme {/*declaring-a-ref-in-a-class-component*/}
6666
67-
To declare a ref inside a [class component,](/reference/react/Component) call `createRef` and assign its result to a class field:
67+
Bir [class component,](/reference/react/Component) içinde bir ref bildirmek için `createRef` çağrısı yapın ve sonucunu bir sınıf alanına atayın:
6868
6969
```js {4}
7070
import { Component, createRef } from 'react';
@@ -76,7 +76,7 @@ class Form extends Component {
7676
}
7777
```
7878
79-
If you now pass `ref={this.inputRef}` to an `<input>` in your JSX, React will populate `this.inputRef.current` with the input DOM node. For example, here is how you make a button that focuses the input:
79+
Şimdi JSX'inizdeki bir `<input>` öğesine `ref={this.inputRef}` iletirseniz, React `this.inputRef.current` öğesini girdi DOM node'u ile dolduracaktır. Örneğin, girişi odaklayan bir node'u şu şekilde yapabilirsiniz:
8080
8181
<Sandpack>
8282
@@ -95,7 +95,7 @@ export default class Form extends Component {
9595
<>
9696
<input ref={this.inputRef} />
9797
<button onClick={this.handleClick}>
98-
Focus the input
98+
Input'a odaklan
9999
</button>
100100
</>
101101
);
@@ -107,7 +107,7 @@ export default class Form extends Component {
107107
108108
<Pitfall>
109109
110-
`createRef` is mostly used for [class components.](/reference/react/Component) Function components typically rely on [`useRef`](/reference/react/useRef) instead.
110+
`createRef` çoğunlukla [sınıf bileşenleri.](/reference/react/Component) için kullanılır. Fonksiyon bileşenleri genellikle bunun yerine [`useRef`](/reference/react/useRef) kullanır.
111111
112112
</Pitfall>
113113

0 commit comments

Comments
 (0)