Uh oh!
There was an error while loading. Please reload this page.
Translation Handling-Events - #17
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
itsnotrisky
left a comment
There was a problem hiding this comment.
I know that Github's markdown support both _ and * to italicize, so I am just following your existing draft here.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
regalius
left a comment
There was a problem hiding this comment.
Looks like just need to adjust several common terms and we're good to go 🎉
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-Authored-By: TitusEfferian <kiritosato@gmail.com>
Co-Authored-By: TitusEfferian <kiritosato@gmail.com>
Co-Authored-By: TitusEfferian <kiritosato@gmail.com>
Co-Authored-By: TitusEfferian <kiritosato@gmail.com>
Co-Authored-By: TitusEfferian <kiritosato@gmail.com>
Co-Authored-By: TitusEfferian <kiritosato@gmail.com>
Co-Authored-By: TitusEfferian <kiritosato@gmail.com>
Co-Authored-By: TitusEfferian <kiritosato@gmail.com>
hello, kindly review once again |
| --- | ||
| Handling events with React elements is very similar to handling events on DOM elements. There are some syntactic differences: | ||
| Menangani sebuah *events* dengan elemen React sangat mirip seperti menangani sebuah *events* pada elemen DOM. Ada beberapa perbedaan sintaks: |
There was a problem hiding this comment.
sintaks -> sintaksis
Lihat: https://kbbi.web.id/sintaksis
| * React events are named using camelCase, rather than lowercase. | ||
| * With JSX you pass a function as the event handler, rather than a string. | ||
| * *Events* pada React biasanya dituliskan dalam bentuk camelCase, dan bukan lowercase. | ||
| * Dengan JSX Anda dapat oper sebuah *function* sebagai *event handler*, dan bukan sebuah *string*. |
There was a problem hiding this comment.
Tidak perlu tanda koma.
Lihat: http://www.indonesia.co.jp/bataone/ruangbahasa49.html
| ``` | ||
| Here, `e` is a synthetic event. React defines these synthetic events according to the [W3C spec](https://www.w3.org/TR/DOM-Level-3-Events/), so you don't need to worry about cross-browser compatibility. See the [`SyntheticEvent`](/docs/events.html) reference guide to learn more. | ||
| Disini, `e` adalah sebuah event tiruan. React mendefinisikan event tiruan ini berdasarkan [W3C spec](https://www.w3.org/TR/DOM-Level-3-Events/), jadi Anda tidak perlu kuatir akan kesesuaian antar lintar browser. Lihat referensi pada [`SyntheticEvent`](/docs/events.html) untuk paduan belajar lebih jauh. |
There was a problem hiding this comment.
Disini -> Di sinievent -> *event*kuatir -> khawatirlintar -> lintasbrowser -> peramban atau *browser*
Lihat: https://kbbi.web.id/browser dan https://id.wikipedia.org/wiki/Daftar_istilah_Internet_Indonesiapaduan -> panduan
| Ini bukan *behavior* pada React secara spesifik, ini merupakan bagian dari [bagaimana sebuah *functions* itu bekerja pada JavaScript](https://www.smashingmagazine.com/2014/01/understanding-javascript-function-prototype-bind/). Pada umumnya jika Anda mereferensi sebuah *method* tanpa `()`, seperti `onClick={this.handleClick}`, maka Anda harus melakukan *binding* terhadap *method* tersebut. | ||
| If calling `bind` annoys you, there are two ways you can get around this. If you are using the experimental [public class fields syntax](https://babeljs.io/docs/plugins/transform-class-properties/), you can use class fields to correctly bind callbacks: | ||
| Jika memanggil `bind` menggangu Anda, ada dua cara untuk mengatasi ini. Jika Anda menggunakan sintaks eksperimental [public class fields](https://babeljs.io/docs/plugins/transform-class-properties/), Anda dapat menggunakan *class fields* untuk melakukan *binding* terhadap *callbacks*: |
| class LoggingButton extends React.Component { | ||
| // This syntax ensures `this` is bound within handleClick. | ||
| // Warning: this is *experimental* syntax. | ||
| // Sintaks ini memastikan `this` telah terikat dalam handleClick. |
Uh oh!
There was an error while loading. Please reload this page.
| ``` | ||
| This syntax is enabled by default in [Create React App](https://github.com/facebookincubator/create-react-app). | ||
| sintaks ini telah diakfifkan secara bawaan pada [Create React App](https://github.com/facebookincubator/create-react-app). |
| Masalah pada sintaks tersebut adalah callback yang berbeda dibuat setiap kali `LoggingButton` di-*render*. Dalam banyak kasus, hal ini tidak masalah. Akan tetapi, jika callback tersebut mengoperkan sebagai props kepada komponen yang lebih rendah, maka komponen tersebut mungkin akan melakukan ekstra *render* ulang. Kita umumnya merekomendasikan *binding* dilakukan pada *constructor* atau menggunakan sintaks *class fields*, untuk menghindari masalah kinerja seperti ini. | ||
| ## Passing Arguments to Event Handlers {#passing-arguments-to-event-handlers} | ||
| ## Mengoper Argumen Kedalam Penanganan Event {#passing-arguments-to-event-handlers} |
There was a problem hiding this comment.
Kedalam -> ke dalam
Lihat: https://beritagar.id/artikel/tabik/kapitalisasi-judul dan https://id.wikipedia.org/wiki/Kata_tugas
| --- | ||
| Handling events with React elements is very similar to handling events on DOM elements. There are some syntactic differences: | ||
| Menangani *events* dengan elemen React sangat mirip seperti menangani sebuah *events* pada elemen DOM. Ada beberapa perbedaan sintaks: |
| Ini bukan *behavior* yang spesifik pada React, tetapi ini merupakan bagian dari [bagaimana *functions* dalam JavaScript bekerja](https://www.smashingmagazine.com/2014/01/understanding-javascript-function-prototype-bind/). Pada umumnya jika Anda mendefinisikan sebuah *method* tanpa diakhiri dengan `()`, seperti `onClick={this.handleClick}`, maka Anda harus melakukan *binding* terhadap *method* tersebut. | ||
| If calling `bind` annoys you, there are two ways you can get around this. If you are using the experimental [public class fields syntax](https://babeljs.io/docs/plugins/transform-class-properties/), you can use class fields to correctly bind callbacks: | ||
| Jika Anda tidak terbiasa menggunakan `bind`, ada dua cara untuk mengatasi ini. Jika Anda menggunakan sintaks eksperimental [public class fields](https://babeljs.io/docs/plugins/transform-class-properties/), Anda dapat menggunakan *class fields* untuk melakukan *binding* terhadap *callbacks*: |
| ``` | ||
| This syntax is enabled by default in [Create React App](https://github.com/facebookincubator/create-react-app). | ||
| Sintaks ini telah diakfifkan secara bawaan pada [Create React App](https://github.com/facebookincubator/create-react-app). |
| Sintaks ini telah diakfifkan secara bawaan pada [Create React App](https://github.com/facebookincubator/create-react-app). | ||
| If you aren't using class fields syntax, you can use an [arrow function](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Arrow_functions) in the callback: | ||
| Jika Anda tidak menggunakan sintaks *class fields*, Anda dapat menggunakan [arrow function](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Arrow_functions) pada *callback*: |
| render() { | ||
| // This syntax ensures `this` is bound within handleClick | ||
| // Sintaks ini memastikan `this` telah terikat dalam handleClick. |
| ``` | ||
| The problem with this syntax is that a different callback is created each time the `LoggingButton` renders. In most cases, this is fine. However, if this callback is passed as a prop to lower components, those components might do an extra re-rendering. We generally recommend binding in the constructor or using the class fields syntax, to avoid this sort of performance problem. | ||
| Masalah pada sintaks tersebut adalah *callback* yang berbeda dibuat setiap kali `LoggingButton` di-*render*. Dalam banyak kasus, hal ini tidak masalah. Akan tetapi, jika callback tersebut mengoperkan sebagai *props* kepada komponen yang lebih rendah, maka komponen tersebut mungkin akan melakukan ekstra *render* ulang. Kita umumnya merekomendasikan *binding* dilakukan pada *constructor* atau menggunakan sintaks *class fields*, untuk menghindari masalah kinerja seperti ini. |
Deploy preview for idreactjs ready! Built with commit 5e07a5b |
TitusEfferian
commented
Feb 18, 2019
@arfianadam already resolved based on your request change |
regalius
commented
Feb 18, 2019
LGTM from me 😄 Thank you for the contribution! |
Deploy preview for id-reactjs ready! Built with commit 5e07a5b |
TitusEfferian
commented
Feb 25, 2019
any updates about this PR? |
regalius
commented
Mar 3, 2019
So sorry, looks like from both @arfianadam and @gedeagas it's LGTM, will merge now mas @TitusEfferian Thanks for the contribution! 🎉 |
No description provided.