From c9e026733e11b131542b479fce0b79326618dbb7 Mon Sep 17 00:00:00 2001
From: Kanish Bodhwani <64742906+kanishbodhwani@users.noreply.github.com>
Date: Mon, 17 Oct 2022 23:42:20 +0530
Subject: [PATCH 1/2] Updated React.md
---
reactjs.md | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/reactjs.md b/reactjs.md
index aa3887d..5fa5352 100644
--- a/reactjs.md
+++ b/reactjs.md
@@ -169,3 +169,21 @@ When you click a submit button, usually page gets refreshed. You can prevent thi
```js
event.preventDefault();
```
+
+# Lists and Keys
+
+This is the example of how we can use lists and keys in react.
+We loop through the numbers array using the JavaScript map() function. We return a `
` element for each item. Finally, we assign the resulting array of elements to listItems
+
+```js
+const numbers = [10, 20, 30, 40, 50];
+const listItems = numbers.map((number) =>
+ {number}
+);
+```
+
+Then, we can include the entire listItems array inside a `` element and return it
+
+```js
+return
+```
From f57c6e7cde12bbb35882f9bc30988d7e8760faa8 Mon Sep 17 00:00:00 2001
From: Kanish Bodhwani <64742906+kanishbodhwani@users.noreply.github.com>
Date: Wed, 19 Oct 2022 19:45:35 +0530
Subject: [PATCH 2/2] Update reactjs.md
---
reactjs.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/reactjs.md b/reactjs.md
index 5fa5352..7ff72a5 100644
--- a/reactjs.md
+++ b/reactjs.md
@@ -185,5 +185,5 @@ const listItems = numbers.map((number) =>
Then, we can include the entire listItems array inside a `` element and return it
```js
-return
+return
```