1function Button({ label, onPress }) {
2 console.log("Button renders:", label);
3 return onPress;
4}
5function App() {
6 let count = 0;
7 const press = Button({
8 label: "Add",
9 onPress: () => { count++; console.log("App owns count:", count); },
10 });
11 press();
12 press();
13}
14App();
●The last lesson is the first thing every tutorial teaches — props and events. We saved it for the end, because only now does its one sentence carry weight: data flows DOWN, events flow UP, and nothing else is allowed.
Twelve lines: a Button that renders a label it was given and rings a bell it was handed. Watch who owns what.
📦 Memory boxes
what the program is remembering right now
nothing remembered yet🖥️ What the computer shows
the answers the program prints out
nothing yet ▌