Lab 4Click EventPassing Data on EventPassing FunctionsBroken Counter: 7Counter: 7Boolean State VariablesDone Yay! Done Urgent !!very urgent!! String State VariablesJohn Doe JD Date State VariablesThu Jan 15 20262026-01-15Fri Jan 16 20262026-01-16Thu Jan 22 20262026-01-22Object State Variables{
"name": "Peter",
"age": 24,
"city": "Boston"
}Array State Variable
Counter 123Counter 123Prop DrillingParent count: 0 ChildThis component never uses count itself. It only forwards props. MiddleGrandchildCount: 0 Addition CalculatorEnter two numbers and navigate using either buttons (programmatic) or links (declarative): Programmatic navigation (using router.push):Declarative navigation (using Link):5 + 10 + 2 → Query Params (Link)5 + 10 + 2 → Path Params (Link)React ContextTwo siblings share one counter without the parent passing props through the middle. Reader: 7WriterContext Todo ListZustand Counter: 7ZustandZustand Counter: 7Zustand Todo ListRedux ToolkitHello ReduxHello ReduxRedux Counter: 7Add ReduxSum: 0Redux Todo List
useEffectThe document title updates after React paints, whenever Writing Your Own HooksuseWindowSizeLoading window size... useToggleuseLocalStorageSelected: Monday. Reload the page and it stays selected. Each caller gets its own state |