From 003638d4c8a0d2d510d68198d75aa6006c1c3f8f Mon Sep 17 00:00:00 2001 From: vishnupprajapat Date: Tue, 7 Jan 2025 20:04:13 +0530 Subject: [PATCH 1/2] Translation of rendering-lists --- src/content/learn/rendering-lists.md | 160 ++++++++++++++------------- 1 file changed, 84 insertions(+), 76 deletions(-) diff --git a/src/content/learn/rendering-lists.md b/src/content/learn/rendering-lists.md index 32f81c447..dd391e656 100644 --- a/src/content/learn/rendering-lists.md +++ b/src/content/learn/rendering-lists.md @@ -1,24 +1,24 @@ --- -title: Rendering Lists +title: सूचियाँ प्रस्तुत करना --- +आप अक्सर किसी डेटा संग्रह से कई समान कंपोनेंट्स प्रदर्शित करना चाहेंगे। डेटा के array को प्रबंधित करने के लिए आप [JavaScript array methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#) का उपयोग कर सकते हैं। इस पेज पर, आप React के साथ [`filter()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) और [`map()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/map) का उपयोग करेंगे ताकि अपने डेटा के array को फ़िल्टर और परिवर्तित करके कंपोनेंट्स के array में बदल सकें। -You will often want to display multiple similar components from a collection of data. You can use the [JavaScript array methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#) to manipulate an array of data. On this page, you'll use [`filter()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) and [`map()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/map) with React to filter and transform your array of data into an array of components. -* How to render components from an array using JavaScript's `map()` -* How to render only specific components using JavaScript's `filter()` -* When and why to use React keys +* JavaScript के `map()` का उपयोग करके array से कंपोनेंट्स को कैसे रेंडर करें। +* JavaScript के `filter()` का उपयोग करके केवल विशेष कंपोनेंट्स को कैसे रेंडर करें। +* React keys का उपयोग कब और क्यों करना चाहिए। -## Rendering data from arrays {/*rendering-data-from-arrays*/} +## Arrays से डेटा रेंडर करना {/*rendering-data-from-arrays*/} -Say that you have a list of content. +मान लीजिए कि आपके पास content की एक सूची है। ```js ``` -The only difference among those list items is their contents, their data. You will often need to show several instances of the same component using different data when building interfaces: from lists of comments to galleries of profile images. In these situations, you can store that data in JavaScript objects and arrays and use methods like [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) and [`filter()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) to render lists of components from them. +उन सूची आइटम्स के बीच केवल एक अंतर होता है: उनकी contents, यानी उनका डेटा। जब आप इंटरफेस बना रहे होते हैं, तो अक्सर आपको एक ही कंपोनेंट के कई उदाहरणों को अलग-अलग डेटा के साथ दिखाने की आवश्यकता होती है, जैसे कि टिप्पणियों की सूची या प्रोफ़ाइल images की गैलरी। ऐसे मामलों में, आप उस डेटा को JavaScript ऑब्जेक्ट्स और arrays में संग्रहीत कर सकते हैं और फिर उनमें से कंपोनेंट्स की सूची रेंडर करने के लिए [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) और [`filter()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) जैसे तरीकों का उपयोग कर सकते हैं। -Here’s a short example of how to generate a list of items from an array: +यहां एक छोटा उदाहरण दिया गया है कि कैसे एक array से आइटम्स की सूची बनाई जा सकती है: -1. **Move** the data into an array: +1. डेटा को एक array में **स्थानांतरित** करें: ```js const people = [ @@ -46,19 +46,19 @@ const people = [ ]; ``` -2. **Map** the `people` members into a new array of JSX nodes, `listItems`: +2. **Map** `people` के सदस्यों को एक नए JSX nodes के array, `listItems`, में परिवर्तित करें: ```js const listItems = people.map(person =>
  • {person}
  • ); ``` -3. **Return** `listItems` from your component wrapped in a `