Drill 5: Summarise — Thinking in components
Summarise the example in one sentence.
What you will be able to do
- Summarise the example in one sentence.
Practice task
Summarise the example in one sentence.
type StudyItem = {
id: string
title: string
minutes: number
}
function StudyItemRow({ item, onSelect }: { item: StudyItem; onSelect: (id: string) => void }) {
return (
<li>
<button onClick={() => onSelect(item.id)}>
{item.title} ({item.minutes} min)
</button>
</li>
)
}
function StudyList({ items, onSelect }: { items: StudyItem[]; onSelect: (id: string) => void }) {
return (
<ul>
{items.map((item) => (
<StudyItemRow key={item.id} item={item} onSelect={onSelect} />
))}
</ul>
)
}Your turn
EasyWrite your answer
Summarise the example in one sentence.
TEXT · starter
Your answer…Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.