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/createRef.md
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,13 @@ title: createRef
4
4
5
5
<Pitfall>
6
6
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).
8
8
9
9
</Pitfall>
10
10
11
11
<Intro>
12
12
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.
14
14
15
15
```js
16
16
classMyInputextendsComponent {
@@ -25,11 +25,11 @@ class MyInput extends Component {
25
25
26
26
---
27
27
28
-
## Reference {/*reference*/}
28
+
## Referensi {/*reference*/}
29
29
30
30
### `createRef()` {/*createref*/}
31
31
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)
33
33
34
34
```js
35
35
import { createRef, Component } from'react';
@@ -40,17 +40,17 @@ class MyComponent extends Component {
40
40
// ...
41
41
```
42
42
43
-
[See more examples below.](#usage)
43
+
[Lihat contoh lebih banyak di bawah.](#usage)
44
44
45
-
#### Parameters {/*parameters*/}
45
+
#### Parameter {/*parameters*/}
46
46
47
-
`createRef`takes no parameters.
47
+
`createRef`tidak memerlukan parameter.
48
48
49
-
#### Returns {/*returns*/}
49
+
#### Balikan {/*returns*/}
50
50
51
-
`createRef`returns an object with a single property:
51
+
`createRef`mengembalikan sebuah objek dengan properti tunggal:
52
52
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`.
0 commit comments