Hands-on practice for this lecture. Write the code, see it run, understand the pattern.
Exercise 1 of 2
Three quick checks that show why PascalCase, flex ratios, and children make a split screen reusable in real layouts.
What this quiz proves
These three checks show why the split screen pattern is reusable instead of one-off: JSX naming, width ratios, and the children pattern.
Question 1
Why are "left" and "right" immediately renamed to "Left" and "Right" in the destructuring?
Question 2
What fraction of the screen does the right panel occupy?
Question 3
What advantage does the children pattern have over passing Left and Right as named props?
0 / 3 answered
Exercise 2 of 2
Live editor: turn a two-panel layout into a reusable component that keeps layout separate from child props and panel widths.
What you gain
Task
Complete SplitScreen.js so it uses leftWidth and rightWidth as flex ratios. Then update App.js to render Sidebar and MainContent through the same reusable wrapper.
Hint: change flex: 1 to flex: leftWidth and flex: rightWidth. Then use the children pattern so each panel keeps its own props.