Skip to content

Commit 4daa374

Browse files
committed
part 2a
1 parent 3b17ec8 commit 4daa374

File tree

2 files changed

+196
-216
lines changed

2 files changed

+196
-216
lines changed

src/content/2/en/part2a.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ Even though the application seems to be working, there is a nasty warning in the
213213

214214
![unique key prop console error](../../images/2/1a.png)
215215

216-
As the linked [React page](https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key) in the error message suggests; the list items, i.e. the elements generated by the _map_ method, must each have a unique key value: an attribute called <i>key</i>.
216+
As the linked [React page](https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key) in the error message suggests; the list items, i.e. the elements generated by the _map_ method, must each have a unique key value: an attribute called <i>key</i>.
217217

218218
Let's add the keys:
219219

@@ -268,7 +268,6 @@ const notes = [
268268

269269
Let's pause for a moment and examine how _map_ works.
270270

271-
272271
If the following code is added to, let's say, the end of the file:
273272

274273
```js
@@ -279,7 +278,6 @@ console.log(result)
279278
<i>[1, 2, 3]</i> will be printed to the console.
280279
_map_ always creates a new array, the elements of which have been created from the elements of the original array by <i>mapping</i>: using the function given as a parameter to the _map_ method.
281280

282-
283281
The function is
284282

285283
```js
@@ -539,7 +537,7 @@ const Course = ({ course }) => {
539537
}
540538
```
541539

542-
Quite often the root of the problem is that the props are expected to be of a different type, or called with a different name than they actually are, and destructuring fails as a result. The problem often begins to solve itself when destructuring is removed and we see what the <em>props</em> contain.
540+
Quite often the root of the problem is that the props are expected to be of a different type, or called with a different name than they actually have, and destructuring fails as a result. The problem often begins to solve itself when destructuring is removed and we see what the <em>props</em> contain.
543541

544542
```js
545543
const Course = (props) => { // highlight-line

0 commit comments

Comments
 (0)