Problems

Memo Boundary Render Count

HardDebugging & Performance

App → Header(memo, props: title) and List(props: items). Each input line is a state change with the props it produces: TITLE ITEMS_JSON. App re-renders every line; Header re-renders only when title changes; List re-renders every time (no memo). After all lines print three lines: App: N, Header: N, List: N.

Input: one title itemsJson per line. Output: three render counts.

Your program reads from stdin and prints to stdout.

Example 1

Input: home [1] home [1,2] about [1,2]

Output: App: 3 Header: 2 List: 3

Hints

ReactPerformanceMemo