Bitpath

Boss lesson · Unit 04

Structure an app

A small shop end to end: component boundaries, a home for each state, fewer wasted renders, the server, and tests.

13 exercisesabout 3 min

What you practise

  • Component boundaries, where each piece of state belongs, avoiding wasted renders, rendering on the server in outline, testing what the user sees

Try a question from this lesson

Pick one

Split this screen into components. Which split gives each component one job?

┌ Shop ──────────────────────┐
│ [ search box ]    Cart: 2  │
│ Tea    4.00   [Add]        │
│ Mug    9.00   [Add]        │
└────────────────────────────┘

The idea

Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.

Concept

Structure first, memo later

Most wasted renders are cured by structure. Keep state close to the components that use it. Let wrapper components take their content as children. Derive values instead of syncing them with effects. If one interaction is still slow, measure it, and only then wrap the slow component in memo.

11 more exercises in the app

  • 1× match the pairs
  • 5× multiple choice
  • 2× type the answer
  • 1× fill the blanks
  • 1× order the lines
  • 1× true or false

Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.

One email when Bitpath is ready to try. Nothing else. Privacy