Skip to content
Open
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
5 changes: 2 additions & 3 deletions 3장/3.2.4-2.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
const PromotionList = [
{ type: "product", name: "chicken" },
{ type: "product", name: "pizza" },
{ type: "card", name: "chee-up" },
{ type: "card", name: "cheer-up" },
];

type ElementOf<T> = (typeof T)[number];
// type PromotionItemType = { type: string; name: string }
type PromotionItemType = ElementOf<PromotionList>;
type PromotionItemType = typeof PromotionList[number];
4 changes: 2 additions & 2 deletions 9장/9.2.1-2.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ const MyComponent = () => {
return (
<div>
<h1>{value}</h1>
<input onChange= {onChange} value= {text} />
<input onChange= {onChange} value= {value} />
</div>
);
};

export default App;
export default MyComponent;