Skip to content

Commit 7ff7f07

Browse files
committed
docs: resolve react reference conflicts
1 parent f77e817 commit 7ff7f07

22 files changed

+153
-1267
lines changed

src/content/reference/react/Component.md

Lines changed: 4 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,7 @@ Hanya *method* `render` yang diperlukan, *method* yang lain adalah opsional.
5050

5151
### `context` {/*context*/}
5252

53-
<<<<<<< HEAD
54-
[Context](/learn/passing-data-deeply-with-context) dari sebuah *class component* tersedia sebagai `this.context`. Ini hanya tersedia jika Anda menentukan context *yang mana* yang ingin Anda terima menggunakan [`static contextType`](#static-contexttype) (modern) atau [`static contextTypes`](#static-contexttypes) (deprecated).
55-
=======
56-
The [context](/learn/passing-data-deeply-with-context) of a class component is available as `this.context`. It is only available if you specify *which* context you want to receive using [`static contextType`](#static-contexttype).
57-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
53+
[Context](/learn/passing-data-deeply-with-context) dari sebuah *class component* tersedia sebagai `this.context`. Ini hanya tersedia jika Anda menentukan context *yang mana* yang ingin Anda terima menggunakan [`static contextType`](#static-contexttype).
5854

5955
*Class component* hanya bisa membaca satu *context* pada satu waktu.
6056

@@ -109,21 +105,6 @@ Membaca `this.props` pada *class components* setara dengan [mendeklarasikan prop
109105

110106
---
111107

112-
<<<<<<< HEAD
113-
### `refs` {/*refs*/}
114-
115-
<Deprecated>
116-
117-
API ini akan dihapus pada versi mayor React di masa depan. [Gunakan `createRef` sebagai gantinya.](/reference/react/createRef)
118-
119-
</Deprecated>
120-
121-
Memungkinkan Anda mengakses [legacy string refs](https://reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs) pada komponen ini.
122-
123-
---
124-
125-
=======
126-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
127108
### `state` {/*state*/}
128109

129110
*State* dari *class component* tersedia sebagai `this.state`. *Field state* harus berupa objek. Jangan mengubah *state* secara langsung. Jika Anda ingin mengubah *state*, panggil `setState` dengan *state* baru.
@@ -501,21 +482,6 @@ Membaca sumber data eksternal dan memaksa komponen kelas untuk me-*render* ulang
501482

502483
---
503484

504-
<<<<<<< HEAD
505-
### `getChildContext()` {/*getchildcontext*/}
506-
507-
<Deprecated>
508-
509-
API ini akan dihapus di versi mayor React yang akan datang. [Gunakan `Context.Provider` sebagai gantinya.](/reference/react/createContext#provider)
510-
511-
</Deprecated>
512-
513-
Memungkinkan Anda menentukan nilai untuk [legacy context](https://reactjs.org/docs/legacy-context.html) yang disediakan oleh komponen ini.
514-
515-
---
516-
517-
=======
518-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
519485
### `getSnapshotBeforeUpdate(prevProps, prevState)` {/*getsnapshotbeforeupdate*/}
520486

521487
Jika Anda mengimplementasikan `getSnapshotBeforeUpdate`, React akan segera memanggilnya sebelum React memperbarui DOM. Ini memungkinkan komponen Anda untuk menangkap beberapa informasi dari DOM (e.g. posisi *scroll*) sebelum berpotensi diubah. Nilai apa pun yang dikembalikan oleh *lifecycle method* ini akan diteruskan sebagai parameter ke [`componentDidUpdate`.](#componentdidupdate)
@@ -748,15 +714,9 @@ React memanggil `shouldComponentUpdate` sebelum *render*-ing ketika *props* baru
748714

749715
#### Parameter {/*shouldcomponentupdate-parameters*/}
750716

751-
<<<<<<< HEAD
752717
- `nextProps`: Props berikutnya yang akan dirender oleh komponen. Bandingkan `nextProps` dengan [`this.props`](#props) untuk menentukan apa yang berubah.
753718
- `nextState`: *State* berikutnya yang akan di-*render* oleh komponen. Bandingkan `nextState` dengan [`this.state`](#props) untuk menentukan apa yang berubah.
754-
- `nextContext`: Konteks berikutnya yang akan di-*render* oleh komponen. Bandingkan `nextContext` dengan [`this.context`](#context) untuk menentukan apa yang berubah. Hanya tersedia jika Anda menetapkan [`static contextType`](#static-contexttypes) (modern) atau [`static contextTypes`](#static-contexttypes) (legacy).
755-
=======
756-
- `nextProps`: The next props that the component is about to render with. Compare `nextProps` to [`this.props`](#props) to determine what changed.
757-
- `nextState`: The next state that the component is about to render with. Compare `nextState` to [`this.state`](#props) to determine what changed.
758-
- `nextContext`: The next context that the component is about to render with. Compare `nextContext` to [`this.context`](#context) to determine what changed. Only available if you specify [`static contextType`](#static-contexttype).
759-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
719+
- `nextContext`: Konteks berikutnya yang akan di-*render* oleh komponen. Bandingkan `nextContext` dengan [`this.context`](#context) untuk menentukan apa yang berubah. Hanya tersedia jika Anda menetapkan [`static contextType`](#static-contexttype).
760720

761721
#### Kembalian {/*shouldcomponentupdate-returns*/}
762722

@@ -830,13 +790,8 @@ Jika Anda mendefinisikan `UNSAFE_componentWillReceiveProps`, React akan memanggi
830790

831791
#### Parameter {/*unsafe_componentwillreceiveprops-parameters*/}
832792

833-
<<<<<<< HEAD
834793
- `nextProps`: *Props* berikutnya yang akan diterima komponen dari komponen induknya. Bandingkan `nextProps` dengan [`this.props`](#props) untuk menentukan apa yang berubah.
835-
- `nextContext`: *Props* berikutnya yang akan diterima komponen dari penyedia terdekat. Bandingkan `nextContext` dengan [`this.context`](#context) untuk menentukan apa yang berubah. Hanya tersedia jika Anda menetapkan [`static contextType`](#static-contexttype) (modern) atau [`static contextTypes`](#static-contexttypes) (legacy).
836-
=======
837-
- `nextProps`: The next props that the component is about to receive from its parent component. Compare `nextProps` to [`this.props`](#props) to determine what changed.
838-
- `nextContext`: The next context that the component is about to receive from the closest provider. Compare `nextContext` to [`this.context`](#context) to determine what changed. Only available if you specify [`static contextType`](#static-contexttype).
839-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
794+
- `nextContext`: *Props* berikutnya yang akan diterima komponen dari penyedia terdekat. Bandingkan `nextContext` dengan [`this.context`](#context) untuk menentukan apa yang berubah. Hanya tersedia jika Anda menetapkan [`static contextType`](#static-contexttype).
840795

841796
#### Kembalian {/*unsafe_componentwillreceiveprops-returns*/}
842797

@@ -901,33 +856,6 @@ Tidak ada persamaan langsung dengan `UNSAFE_componentWillUpdate` dalam *function
901856

902857
---
903858

904-
<<<<<<< HEAD
905-
### `static childContextTypes` {/*static-childcontexttypes*/}
906-
907-
<Deprecated>
908-
909-
API ini akan dihapus di versi mayor React yang akan datang. [Gunakan `static contextType` sebagai gantinya.](#static-contexttype)
910-
911-
</Deprecated>
912-
913-
Memungkinkan Anda menentukan [legacy context](https://reactjs.org/docs/legacy-context.html) mana yang disediakan oleh komponen ini.
914-
915-
---
916-
917-
### `static contextTypes` {/*static-contexttypes*/}
918-
919-
<Deprecated>
920-
921-
API ini akan dihapus di versi mayor React yang akan datang. [Gunakan `static contextType` sebagai gantinya.](#static-contexttype)
922-
923-
</Deprecated>
924-
925-
Memungkinkan Anda menentukan [legacy context](https://reactjs.org/docs/legacy-context.html) yang dikonsumsi oleh komponen ini.
926-
927-
---
928-
929-
=======
930-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
931859
### `static contextType` {/*static-contexttype*/}
932860

933861
Jika Anda ingin membaca [`this.context`](#context-instance-field) dari *class component* Anda, Anda harus menentukan *context* mana yang perlu dibaca. *Context* yang Anda tentukan sebagai `static contextType` harus berupa nilai yang dibuat sebelumnya oleh [`createContext`.](/reference/react/createContext)
@@ -1002,37 +930,6 @@ Mendefinisikan `defaultProps` pada *class components* serupa dengan menggunakan
1002930
1003931
---
1004932
1005-
<<<<<<< HEAD
1006-
### `static propTypes` {/*static-proptypes*/}
1007-
1008-
Anda dapat mendefinisikan `static propTypes` bersama dengan pustaka [`prop-types`](https://www.npmjs.com/package/prop-types) untuk mendeklarasikan jenis *props* yang diterima oleh komponen Anda. Jenis ini akan diperiksa selama *render*-ing dan hanya dalam pengembangan.
1009-
1010-
```js
1011-
import PropTypes from 'prop-types';
1012-
1013-
class Greeting extends React.Component {
1014-
static propTypes = {
1015-
name: PropTypes.string
1016-
};
1017-
1018-
render() {
1019-
return (
1020-
<h1>Hello, {this.props.name}</h1>
1021-
);
1022-
}
1023-
}
1024-
```
1025-
1026-
<Note>
1027-
1028-
Kami merekomendasikan menggunakan [TypeScript](https://www.typescriptlang.org/) daripada memeriksa *prop types* pada *runtime*.
1029-
1030-
</Note>
1031-
1032-
---
1033-
1034-
=======
1035-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
1036933
### `static getDerivedStateFromError(error)` {/*static-getderivedstatefromerror*/}
1037934
1038935
Jika Anda mendefinisikan `static getDerivedStateFromError`, React akan memanggilnya ketika komponen anak (termasuk anak jauh) melemparkan kesalahan selama *render*-ing. Ini memungkinkan Anda menampilkan pesan kesalahan alih-alih menghapus UI.
@@ -1395,17 +1292,9 @@ class ErrorBoundary extends React.Component {
13951292
}
13961293

13971294
componentDidCatch(error, info) {
1398-
<<<<<<< HEAD
1399-
// Contoh "componentStack":
1400-
// in ComponentThatThrows (created by App)
1401-
// in ErrorBoundary (created by App)
1402-
// in div (created by App)
1403-
// in App
1404-
logErrorToMyService(error, info.componentStack);
1405-
=======
14061295
logErrorToMyService(
14071296
error,
1408-
// Example "componentStack":
1297+
// Contoh "componentStack":
14091298
// in ComponentThatThrows (created by App)
14101299
// in ErrorBoundary (created by App)
14111300
// in div (created by App)
@@ -1414,7 +1303,6 @@ class ErrorBoundary extends React.Component {
14141303
// Warning: `captureOwnerStack` is not available in production.
14151304
React.captureOwnerStack(),
14161305
);
1417-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
14181306
}
14191307

14201308
render() {

0 commit comments

Comments
 (0)