Skip to content

Commit ec3adfe

Browse files
authored
wip translation
1 parent 13f63d0 commit ec3adfe

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/content/reference/react/createRef.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ title: createRef
44

55
<Pitfall>
66

7-
`createRef` is mostly used for [class components.](/reference/react/Component) Function components typically rely on [`useRef`](/reference/react/useRef) instead.
7+
`createRef` kebanyakan digunakan untuk [komponen kelas.](/reference/react/Component) sedangkan komponen fungsional biasanya mengandalkan [`useRef`](/reference/react/useRef).
88

99
</Pitfall>
1010

1111
<Intro>
1212

13-
`createRef` creates a [ref](/learn/referencing-values-with-refs) object which can contain arbitrary value.
13+
`createRef` membuat sebuah objek [*ref*](/learn/referencing-values-with-refs) yang menyimpan nilai apapun.
1414

1515
```js
1616
class MyInput extends Component {
@@ -25,11 +25,11 @@ class MyInput extends Component {
2525

2626
---
2727

28-
## Reference {/*reference*/}
28+
## Referensi {/*reference*/}
2929

3030
### `createRef()` {/*createref*/}
3131

32-
Call `createRef` to declare a [ref](/learn/referencing-values-with-refs) inside a [class component.](/reference/react/Component)
32+
Panggil `createRef` untuk mendeklarasikan sebuah [*ref*](/learn/referencing-values-with-refs) di dalam sebuah [komponen kelas.](/reference/react/Component)
3333

3434
```js
3535
import { createRef, Component } from 'react';
@@ -40,17 +40,17 @@ class MyComponent extends Component {
4040
// ...
4141
```
4242
43-
[See more examples below.](#usage)
43+
[Lihat contoh lebih banyak di bawah.](#usage)
4444
45-
#### Parameters {/*parameters*/}
45+
#### Parameter {/*parameters*/}
4646
47-
`createRef` takes no parameters.
47+
`createRef` tidak memerlukan parameter.
4848
49-
#### Returns {/*returns*/}
49+
#### Kembalian {/*returns*/}
5050
51-
`createRef` returns an object with a single property:
51+
`createRef` mengembalikan sebuah objek dengan properti tunggal:
5252
53-
* `current`: Initially, it's set to the `null`. You can later set it to something else. If you pass the ref object to React as a `ref` attribute to a JSX node, React will set its `current` property.
53+
* `current`: Awalnya, bernilai `null`. Anda dapat menggantinya dengan nilai lain kemudian. Jika Anda mengoper objek *ref* ke React sebagai sebuah atribut `ref` di dalam simpul JSX, React akan menetapkannya sebagai properti `current`.
5454
5555
#### Caveats {/*caveats*/}
5656

0 commit comments

Comments
 (0)