Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small exercise updates #373

Merged
merged 2 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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