Skip to content

Commit c919053

Browse files
committed
adding package locks and with the new version of react-scripts, they complain if we dont have a browserlist in package.json
1 parent 5239eda commit c919053

21 files changed

+99351
-113
lines changed

Diff for: .prettierrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tabWidth: 2
2+
semi: false
3+
singleQuote: true

Diff for: 1-rendering/package.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,11 @@
1313
"build": "react-scripts build",
1414
"test": "react-scripts test --env=jsdom",
1515
"eject": "react-scripts eject"
16-
}
16+
},
17+
"browserslist": [
18+
">0.2%",
19+
"not dead",
20+
"not ie <= 11",
21+
"not op_mini all"
22+
]
1723
}

Diff for: 1-rendering/src/solution.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const element = (
3838
{DATA.items
3939
.filter(item => item.type === "mexican")
4040
.sort(sortBy("name"))
41-
.map(item => <li>{item.name}</li>)}
41+
.map(item => <li key={item.id}>{item.name}</li>)}
4242
</ul>
4343
</div>
4444
);

Diff for: 2-composition/package.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,11 @@
1313
"build": "react-scripts build",
1414
"test": "react-scripts test --env=jsdom",
1515
"eject": "react-scripts eject"
16-
}
16+
},
17+
"browserslist": [
18+
">0.2%",
19+
"not dead",
20+
"not ie <= 11",
21+
"not op_mini all"
22+
]
1723
}

Diff for: 2-composition/src/exercise.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ ReactDOM.render(
4141
<h1>Menu</h1>
4242
<ul>
4343
{items.sort(sortBy("name")).map(item => (
44-
<li>
44+
<li key={item.id}>
4545
{item.name} - <small>${item.price}</small>
4646
</li>
4747
))}

Diff for: 2-composition/src/lecture.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ ReactDOM.render(
1515
<ul>
1616
{tacos
1717
.sort((a, b) => b.stars - a.stars)
18-
.map(taco => (
19-
<li style={{ margin: "10px" }}>
18+
.map((taco, i) => (
19+
<li key={i} style={{ margin: "10px" }}>
2020
<button
2121
onClick={() =>
2222
alert(taco.name + " is my favorite!")

Diff for: 2-composition/src/solution.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ let Menu = ({ title, items }) => (
4848
<ul>
4949
{items
5050
.sort(sortBy("name"))
51-
.map(item => <MenuItem item={item} />)}
51+
.map(item => <MenuItem key={item.id} item={item} />)}
5252
</ul>
5353
</div>
5454
);

0 commit comments

Comments
 (0)