Translated "Responding to Events" page by tushgaurav · Pull Request #311 · reactjs/hi.react.dev
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this.
added a few minor comments
| </YouWillLearn> | ||
|
|
||
| ## Adding event handlers {/*adding-event-handlers*/} | ||
| ## Event handler डालना {/*adding-event-handlers*/} |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ## Event handler डालना {/*adding-event-handlers*/} | |
| ## Event handler ऐड करना {/*adding-event-handlers*/} |
| ## Event handler डालना {/*adding-event-handlers*/} | ||
|
|
||
| To add an event handler, you will first define a function and then [pass it as a prop](/learn/passing-props-to-a-component) to the appropriate JSX tag. For example, here is a button that doesn't do anything yet: | ||
| Event handler जोड़ने के लिए, पहले एक फंक्शन को परिभाषित करें और फिर उसे props के रूप में पास करें उपयुक्त JSX टैग में। उदाहरण के लिए, यहाँ एक बटन है जो अभी कुछ नहीं करता है: |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Event handler जोड़ने के लिए, पहले एक फंक्शन को परिभाषित करें और फिर उसे props के रूप में पास करें उपयुक्त JSX टैग में। उदाहरण के लिए, यहाँ एक बटन है जो अभी कुछ नहीं करता है: | |
| Event handler ऐड करने के लिए, पहले एक फंक्शन को परिभाषित करें और फिर उसे props के रूप में पास करें उपयुक्त JSX टैग में। उदाहरण के लिए, यहाँ एक बटन है जो अभी कुछ नहीं करता है: |
| </Sandpack> | ||
|
|
||
| You can make it show a message when a user clicks by following these three steps: | ||
| आप उपयोगकर्ता द्वारा क्लिक करने पर संदेश दिखाने के लिए निम्न तीन चरणों का पालन कर सकते हैं: |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| आप उपयोगकर्ता द्वारा क्लिक करने पर संदेश दिखाने के लिए निम्न तीन चरणों का पालन कर सकते हैं: | |
| आप यूजर द्वारा क्लिक करने पर संदेश दिखाने के लिए निम्न तीन चरणों का पालन कर सकते हैं: |
| 1. Declare a function called `handleClick` *inside* your `Button` component. | ||
| 2. Implement the logic inside that function (use `alert` to show the message). | ||
| 3. Add `onClick={handleClick}` to the `<button>` JSX. | ||
| 1. अपने `Button` कौम्पोनॅन्ट के *अंदर* `handleClick` नाम का एक फंक्शन घोषित करें। |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 1. अपने `Button` कौम्पोनॅन्ट के *अंदर* `handleClick` नाम का एक फंक्शन घोषित करें। | |
| 1. अपने `Button` कौम्पोनॅन्ट के *अंदर* `handleClick` नाम का एक फंक्शन डिक्लेअर करें। |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you delete this file.