Skip to content

Commit 239908d

Browse files
committed
edits, order image
1 parent fabb168 commit 239908d

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

lessons/03-tools/C-linting.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,14 @@ export default [
5353
- [globals][globals] is a package that is just a big JSON file of what's available in each environment. We're going to be in Node.js and Browser environments so we grabbed those two. If I was being a bit more discerning I'd carefully only apply browser configs to browser files and Node configs to Node.js files.
5454
- The config objects are applied in order. We did ESLint's JS config first, and then our custom one so we can overwrite it where we want to, and then the Prettier one should always come last as all it does is turn off rules that Prettier itself does; it doesn't add anything.
5555

56-
This is a combination of the recommended configs of ESLint and Prettier. This will lint for both normal JS stuff as well as JSX stuff. Run `npx eslint` now and you should see we have a few errors. Run it again with the `--fix` flag and see it will fix some of it for us! Go fix the rest of your errors and come back. Let's go add this to our npm scripts.
56+
This is a combination of the recommended configs of ESLint and Prettier. This will lint for both normal JS stuff as well as JSX stuff. Let's add ESLint to our scripts:
5757

5858
```json
5959
"lint": "eslint",
6060
```
6161

62+
Run `npm run eslint` now and you should see we have a few errors.
63+
6264
> 🚨 ESLint will have a bunch of errors right now. Ignore them; we'll fix them in a sec.
6365
6466
Worth adding three things here:

lessons/04-core-react-concepts/A-jsx.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ reactPlugin.configs.flat["jsx-runtime"],
7575
// add to files
7676
files: ["**/*.js", "**/*.jsx"], // add JSX
7777

78-
// inside the same object files, after the languageOptions:
78+
//after the languageOptions object:
7979
rules: {
8080
"react/no-unescaped-entities": "off",
8181
"react/prop-types": "off",
@@ -86,7 +86,7 @@ You can also copy fill config from [the repo][eslint].
8686

8787
We have to add two configs, one to allow ESLint to understand React and add some basic React rules, and one to modernize it as React 17 changed a bit how ESLint interacts with React.
8888

89-
We're also turning off two rules that I don't find particularly useful: unescaped entites (which make you change things like `'` into `&apos`) and prop types which no one has used in a decade at this point. Otherwise we should be good to go.
89+
We're also turning off two rules that I don't find particularly useful: unescaped entities (which make you change things like `'` into `&apos`) and prop types which no one has used in a decade at this point. Otherwise we should be good to go.
9090

9191
## Back to JSX
9292

lessons/04-core-react-concepts/B-hooks.md

+4
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ import Order from "./Order";
102102
103103
Now navigate to [http://localhost:5173/]() and see that you have two inputs, one for the pizza type and a set of radio buttons for the size. Try and select something with the inputs. You'll see that you can't modify them. Why? Let's think about how React works: when you interact with the inputs, React detects that a DOM event happens. When that happens, React thinks _something_ may have changed so it runs a re-render. Providing your render functions are fast, this is a very quick operation. It then diffs what's currently there and what its render pass came up with. It then updates the minimum amount of DOM necessary.
104104

105+
> In the recorded course, the layout is vertical because the `order-pizza` DIV was in the wrong place. Use the markup above. The layout should look like this:
106+
107+
![Order Page Layout](/images/order-page-layout.webp)
108+
105109
Notice we're using `className` instead of `class` on the HTML element for CSS classes. This is because `class` is a reserved word in JS and JSX is still just JS. So instead they opted to use `className` which is the [name of the JS API][js-api] for interacting with class names.
106110

107111
Like `className`, `htmlFor` is used because `for` is a reserved word in JS.
17.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)