Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translated React Without ES6 #49

Merged
merged 1 commit into from Feb 3, 2020
Merged

Translated React Without ES6 #49

merged 1 commit into from Feb 3, 2020

Conversation

lunmay
Copy link
Contributor

@lunmay lunmay commented Feb 28, 2019

No description provided.

@netlify
Copy link

netlify bot commented Feb 28, 2019

Deploy preview for idreactjs ready!

Built with commit fe6c8d1

https://deploy-preview-49--idreactjs.netlify.com

@netlify
Copy link

netlify bot commented Feb 28, 2019

Deploy preview for id-reactjs ready!

Built with commit fe6c8d1

https://deploy-preview-49--id-reactjs.netlify.com

Copy link
Member

@regalius regalius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lunmay , There's several typo that needs to be fixed and we'll be good to go!


## Declaring Default Props {#declaring-default-props}
## Mendeklarasikan *Props* *Default* {#declaring-default-props}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loanwords in the heading doesn't have to be italicized 😄


In React components declared as ES6 classes, methods follow the same semantics as regular ES6 classes. This means that they don't automatically bind `this` to the instance. You'll have to explicitly use `.bind(this)` in the constructor:
Pada komponen React yang dideklarasikan sebagai kelas ES6, *method* mengikuti semantik yang sama seperti kelas ES6 reguler. Ini berarti *method* tersebut tidak secara otomatis mem-*bind* `this` kepada instans. Anda harus secara eksplisit menggunakan `.bind(this)` pada konstruktor:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instans -> instance

}
// WARNING: this syntax is experimental!
// Using an arrow here binds the method:
// PERINGATAN: sintalsis ini bersifat eksperimental!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sintaksis typo I think 😄

>
>**We also found numerous issues in codebases using mixins, [and don't recommend using them in the new code](/blog/2016/07/13/mixins-considered-harmful.html).**
>**Kami juga menemukan banyak masalah pada kode dasar yang menggunakan *mixin*, [dan tidak menyarankan untuk menggunakannya untuk kode yang baru](/blog/2016/07/13/mixins-considered-harmful.html).**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
>**Kami juga menemukan banyak masalah pada kode dasar yang menggunakan *mixin*, [dan tidak menyarankan untuk menggunakannya untuk kode yang baru](/blog/2016/07/13/mixins-considered-harmful.html).**
>**Kami juga menemukan banyak masalah pada basis kode yang menggunakan *mixin*, [dan tidak menyarankan untuk menggunakannya untuk kode yang baru](/blog/2016/07/13/mixins-considered-harmful.html).**

What do you think? 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@@ -222,4 +223,4 @@ ReactDOM.render(
);
```

If a component is using multiple mixins and several mixins define the same lifecycle method (i.e. several mixins want to do some cleanup when the component is destroyed), all of the lifecycle methods are guaranteed to be called. Methods defined on mixins run in the order mixins were listed, followed by a method call on the component.
Jika komponen menggunakan beberapa *mixin* dan beberapa *mixin* mendefinisikan *lifecycle method* yang sama (beberapa *mixin* ingin melakukan pembersihan ketika komponen dihancurkan), semua *lifecycle method* dijamin untuk dipanggil. *Method* yang didefiniskan pada *mixin* dijalankan secara berurutan sesuai dengan dengan proses pendaftarannya, diikuti dengan pemanggilan *method* pada komponen.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Jika komponen menggunakan beberapa *mixin* dan beberapa *mixin* mendefinisikan *lifecycle method* yang sama (beberapa *mixin* ingin melakukan pembersihan ketika komponen dihancurkan), semua *lifecycle method* dijamin untuk dipanggil. *Method* yang didefiniskan pada *mixin* dijalankan secara berurutan sesuai dengan dengan proses pendaftarannya, diikuti dengan pemanggilan *method* pada komponen.
Jika komponen menggunakan beberapa *mixin* dan beberapa *mixin* mendefinisikan *lifecycle method* yang sama (contohnya, beberapa *mixin* ingin melakukan pembersihan ketika komponen dihancurkan), semua *lifecycle method* dijamin untuk dipanggil. *Method* yang didefinisikan pada *mixin* dijalankan secara berurutan sesuai dengan dengan proses pendaftarannya, diikuti dengan pemanggilan *method* pada komponen.

Several typos I think 😄


## Declaring Default Props {#declaring-default-props}
## Mendeklarasikan *Props* *Default* {#declaring-default-props}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Mendeklarasikan *Props* *Default* {#declaring-default-props}
## Mendeklarasikan Props Default {#declaring-default-props}

};
```

With `createReactClass()`, you need to define `getDefaultProps()` as a function on the passed object:
Dengan `createReactClass()`, Anda harus mendefinisikan `getDefaultProps()` sebagai fungsi pada objek yang dioperkan:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which one sounds better? dioperkan or diberikan?

Suggested change
Dengan `createReactClass()`, Anda harus mendefinisikan `getDefaultProps()` sebagai fungsi pada objek yang dioperkan:
Dengan `createReactClass()`, Anda harus mendefinisikan `getDefaultProps()` sebagai fungsi pada objek yang diberikan:

@@ -57,9 +57,9 @@ var Greeting = createReactClass({
});
```

## Setting the Initial State {#setting-the-initial-state}
## Menyetel *State* Awal {#setting-the-initial-state}
Copy link
Member

@grikomsn grikomsn Jan 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Menyetel *State* Awal {#setting-the-initial-state}
## Mengatur State Awal {#setting-the-initial-state}

@@ -82,16 +82,16 @@ var Counter = createReactClass({
});
```

## Autobinding {#autobinding}
## *Autobinding* {#autobinding}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## *Autobinding* {#autobinding}
## Autobinding {#autobinding}


In React components declared as ES6 classes, methods follow the same semantics as regular ES6 classes. This means that they don't automatically bind `this` to the instance. You'll have to explicitly use `.bind(this)` in the constructor:
Pada komponen React yang dideklarasikan sebagai kelas ES6, *method* mengikuti semantik yang sama seperti kelas ES6 reguler. Ini berarti *method* tersebut tidak secara otomatis mem-*bind* `this` kepada instans. Anda harus secara eksplisit menggunakan `.bind(this)` pada konstruktor:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Pada komponen React yang dideklarasikan sebagai kelas ES6, *method* mengikuti semantik yang sama seperti kelas ES6 reguler. Ini berarti *method* tersebut tidak secara otomatis mem-*bind* `this` kepada instans. Anda harus secara eksplisit menggunakan `.bind(this)` pada konstruktor:
Pada komponen React yang dideklarasikan sebagai kelas ES6, *method* mengikuti semantik yang sama seperti kelas ES6 reguler. Ini berarti *method* tersebut tidak secara otomatis mem-*bind* `this` kepada *instance*. Anda harus secara eksplisit menggunakan `.bind(this)` pada konstruktor:

}
// WARNING: this syntax is experimental!
// Using an arrow here binds the method:
// PERINGATAN: sintalsis ini bersifat eksperimental!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// PERINGATAN: sintalsis ini bersifat eksperimental!
// PERINGATAN: sintaksis ini bersifat eksperimental!


If you'd rather play it safe, you have a few options:
Jika Anda ingin bermain pada area yang aman, Anda memiliki beberapa opsi:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Jika Anda ingin bermain pada area yang aman, Anda memiliki beberapa opsi:
Jika Anda ingin bermain aman, Anda memiliki beberapa opsi:

Also, should idioms like play it safe be translated as is?

* Keep using `createReactClass`.
* Mem-*bind* *method* dalam konstruktor.
* Gunakan *arrow function*, misalnya `onClick={(e) => this.handleClick(e)}`.
* Terus gunakan `createReactClass`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Terus gunakan `createReactClass`.
* Tetap menggunakan `createReactClass`.

@resir014 resir014 merged commit fe6c8d1 into reactjs:master Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants