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

[Translation] Building Your Own Hooks #68

Closed

Conversation

visshaljagtap
Copy link
Member

@visshaljagtap visshaljagtap commented Feb 12, 2020

Hi @arshadkazmi42, please review and let me know if any changes needed!

@netlify
Copy link

netlify bot commented Feb 12, 2020

Deploy preview for hi-reactjs ready!

Built with commit 0592c1b

https://deploy-preview-68--hi-reactjs.netlify.app

@arshadkazmi42 arshadkazmi42 added the 1st Review First phase of review label Feb 15, 2020
@arshadkazmi42
Copy link
Member

Thanks @visshaljagtap for working on this.
But right now we are prioritizing the pages listed in #1
Please take pages from there, once those are closed we will start with other pages.
I am parking this PR for now. We will get to this when we start working on content pages

@arshadkazmi42 arshadkazmi42 added Parked parked until further notice and removed 1st Review First phase of review labels Feb 27, 2020
@visshaljagtap
Copy link
Member Author

visshaljagtap commented Mar 4, 2020

@arshadkazmi42 I have taken the page that is listed in #1 itself also the page is already assigned to me. I think hooks pages translation should also be on priority.

@arshadkazmi42
Copy link
Member

@visshaljagtap Yes. Right.
Sorry about that. This is a valid page. I will start reviewing this soon

@arshadkazmi42 arshadkazmi42 added 1st Review First phase of review and removed Parked parked until further notice labels Mar 5, 2020
@visshaljagtap
Copy link
Member Author

Any updates @arshadkazmi42

@arshadkazmi42
Copy link
Member

@visshaljagtap I have been a bit busy. I will get to it soon

Copy link
Member

@arshadkazmi42 arshadkazmi42 left a comment

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. And great start.
i have added couple of feedbacks. can you go through and fix those.
We will continue review once these are fixed.
Refer #23 to know more about our review process

Added review till line 197

content/docs/hooks-custom.md Outdated Show resolved Hide resolved
@@ -36,7 +36,7 @@ function FriendStatus(props) {
}
```

Now let's say that our chat application also has a contact list, and we want to render names of online users with a green color. We could copy and paste similar logic above into our `FriendListItem` component but it wouldn't be ideal:
अब बताते हैं कि हमारे चैट एप्लिकेशन की एक संपर्क सूची भी है, और हम हरे रंग के साथ ऑनलाइन उपयोगकर्ताओं के नाम प्रस्तुत करना चाहते हैं | हम इसी तरह के लॉजिक को अपने `FriendListItem` में कॉपी और पेस्ट कर सकते हैं लेकिन यह सही नहीं होगा:
Copy link
Member

Choose a reason for hiding this comment

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

करना चाहते हैं | => करना चाहते हैं।


Traditionally in React, we've had two popular ways to share stateful logic between components: [render props](/docs/render-props.html) and [higher-order components](/docs/higher-order-components.html). We will now look at how Hooks solve many of the same problems without forcing you to add more components to the tree.
परंपरागत रूप से React में, हमारे पास कौम्पोनॅन्ट के बीच स्टेटफुल लॉजिक शेयर करने के दो लोकप्रिय तरीके हैं: [रेंडर प्रॉप्स](/docs/render-props.html) and [higher-order कौम्पोनॅन्ट](/docs/higher-order-components.html) | अब हम इस बात पर ध्यान देंगे कि Hooks आपको आपके tree में अधिक कौम्पोनॅन्ट को ऐड करने के लिए मजबूर किए बिना कैसे समस्याओं का समाधान करते हैं।
Copy link
Member

Choose a reason for hiding this comment

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

कौम्पोनॅन्ट => कौम्पोनॅन्टस

change this at both the places


Traditionally in React, we've had two popular ways to share stateful logic between components: [render props](/docs/render-props.html) and [higher-order components](/docs/higher-order-components.html). We will now look at how Hooks solve many of the same problems without forcing you to add more components to the tree.
परंपरागत रूप से React में, हमारे पास कौम्पोनॅन्ट के बीच स्टेटफुल लॉजिक शेयर करने के दो लोकप्रिय तरीके हैं: [रेंडर प्रॉप्स](/docs/render-props.html) and [higher-order कौम्पोनॅन्ट](/docs/higher-order-components.html) | अब हम इस बात पर ध्यान देंगे कि Hooks आपको आपके tree में अधिक कौम्पोनॅन्ट को ऐड करने के लिए मजबूर किए बिना कैसे समस्याओं का समाधान करते हैं।
Copy link
Member

Choose a reason for hiding this comment

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

html) | अब हम => html)। अब हम


When we want to share logic between two JavaScript functions, we extract it to a third function. Both components and Hooks are functions, so this works for them too!
जब हम दो JavaScript फंक्शन के बीच लॉजिक शेयर करना चाहते हैं, तब हम इसे तीसरे फंक्शन में निकालते हैं। दोनों कौम्पोनॅन्ट और Hook फंक्शन हैं, तो यह उनके लिए भी काम करता है!
Copy link
Member

Choose a reason for hiding this comment

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

कौम्पोनॅन्ट => कौम्पोनॅन्टस


### Tip: Pass Information Between Hooks {#tip-pass-information-between-hooks}
### टिप: Hook के बीच जानकारी पास करें
{#tip-pass-information-between-hooks}
Copy link
Member

Choose a reason for hiding this comment

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

move this to line 152


To illustrate this, we'll use another component from our hypothetical chat example. This is a chat message recipient picker that displays whether the currently selected friend is online:
इसे समझने के लिए, हम अपने काल्पनिक चैट उदाहरण से एक और कौम्पोनॅन्ट का उपयोग करेंगे | यह एक चैट संदेश प्राप्तकर्ता पिकर है जो प्रदर्शित करता है कि वर्तमान में चुना गया दोस्त ऑनलाइन है:
Copy link
Member

Choose a reason for hiding this comment

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

करेंगे | => करेंगे।

@@ -183,25 +184,24 @@ function ChatRecipientPicker() {
);
}
```
हम चुना गया friend ID को `recipientID` state variable में रखते हैं, और इसे अपडेट करेंगे यदि यूजर `<select>` पिकर में एक अलग दोस्त चुनता है।
Copy link
Member

Choose a reason for hiding this comment

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

चुना गया => चुने गए

@@ -183,25 +184,24 @@ function ChatRecipientPicker() {
);
}
```
हम चुना गया friend ID को `recipientID` state variable में रखते हैं, और इसे अपडेट करेंगे यदि यूजर `<select>` पिकर में एक अलग दोस्त चुनता है।
Copy link
Member

Choose a reason for hiding this comment

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

variable => वेरिएबल


```js
const [recipientID, setRecipientID] = useState(1);
const isRecipientOnline = useFriendStatus(recipientID);
```

This lets us know whether the *currently selected* friend is online. If we pick a different friend and update the `recipientID` state variable, our `useFriendStatus` Hook will unsubscribe from the previously selected friend, and subscribe to the status of the newly selected one.
इससे हमें पता चलता है कि *वर्तमान में चयनित* मित्र ऑनलाइन है या नहीं| अगर हम एक अलग दोस्त चुनें और `recipientID` state variable अद्यतन करें, तो हमारा `useFriendStatus` Hook पहले से चयनित दोस्त से सदस्यता समाप्त कर देगा, और नव चयनित एक की स्टेटस के लिए सदस्यता लें।
Copy link
Member

Choose a reason for hiding this comment

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

नहीं| => नहीं।

@visshaljagtap
Copy link
Member Author

@arshadkazmi42 Done with the mentioned changes please review!

@visshaljagtap
Copy link
Member Author

@arshadkazmi42 Done with the mentioned changes please review!

any updates @arshadkazmi42

@visshaljagtap
Copy link
Member Author

Awaiting @arshadkazmi42

@arshadkazmi42
Copy link
Member

@visshaljagtap little occupied. will get to it soon

@arshadkazmi42
Copy link
Member

We are moving our focus to beta pages. So closing this now.

Sorry about this, but feel free to pick a new page from #168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1st Review First phase of review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants