Skip to content

Commit

Permalink
small exercise updates (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
Creeland authored Aug 31, 2024
1 parent 65e6070 commit 4e28dac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions exercises/06.styling/03.problem.size-prop/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ In this step, try to make this API work:
small lightblue box
</Box>
```

- You'll need πŸ“œ
[TypeScript's intersection (&) operator](https://www.typescriptlang.org/docs/handbook/2/objects.html#intersection-types)
4 changes: 2 additions & 2 deletions exercises/06.styling/03.problem.size-prop/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export function Box({
style = {},
className = '',
// 🐨 add a size prop here
...otherProps // 🦺 union this with an object that has a size prop type here which is
// optional and one of "small", "medium", or "large"
...otherProps // 🦺 intersect (&) this with an object that has a size prop type here which is
// optional and is one of "small", "medium", or "large"
}: React.ComponentProps<'div'>) {
// 🐨 based on the size prop, define a new variable called sizeClassName
return (
Expand Down
1 change: 1 addition & 0 deletions exercises/07.forms/01.problem.form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ function App() {
// 🐨 render a form
// 🐨 render a "Username" label
// 🐨 render an input with the name "username"
// 🐨 render a button
// πŸ’― associate the label to the input using htmlFor and id attributes
// πŸ’― explicitly set the button type appropriately
return 'TODO'
Expand Down

0 comments on commit 4e28dac

Please sign in to comment.