Skip to content

Commit 1a9464e

Browse files
committed
small fix
1 parent 025dac1 commit 1a9464e

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"start": "vite-node scripts/start.ts",
8+
"dev": "npm start",
89
"kill-db-port": "node scripts/kill-db-port 3333",
910
"install-remix": "cd remix && npm install",
1011
"test": "jest"

react/core/02-state/lecture/GroceryForm.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export function GroceryForm({ onSubmit }: Props) {
1313
// Teach refs with typescript
1414

1515
function handleSubmit(event) {
16-
// Typescript has no idea what "event" is
17-
//
16+
// Typescript has no idea what "event" is, so use "currentEvent"
17+
1818
// Three basic ways to get our form's fields
1919
// 1. new FormData
2020
// 2. Scrape for it: ids (bad) refs (good)
@@ -27,11 +27,11 @@ export function GroceryForm({ onSubmit }: Props) {
2727
<form onSubmit={handleSubmit} className="space-y-3">
2828
<div>
2929
<label htmlFor="item">Item</label>
30-
<input id="item" type="text" className="form-field" autoComplete="off" />
30+
<input id="itemName" type="text" className="form-field" autoComplete="off" name="name" />
3131
</div>
3232
<div>
3333
<label htmlFor="quantity">Quantity</label>
34-
<input id="quantity" type="text" className="form-field" />
34+
<input id="itemQuantity" type="text" className="form-field" name="quantity" />
3535
</div>
3636
<footer>
3737
<button type="submit" className="button">

react/core/02-state/lecture/GroceryList.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function GroceryList({ items, subtractQuantity, addQuantity }: Props) {
2323
<>
2424
<div className="space-y-3">
2525
{/* Map over items */}
26-
<div className="flex gap-6 bg-slate-100 p-4">
26+
<div className="flex gap-6 items-center bg-slate-100 p-4">
2727
<div className="flex-1">Eggs</div>
2828
<div className="flex-1">Quantity: 12</div>
2929
<div className="flex-1 flex gap-2">

0 commit comments

Comments
 (0)