React Component API
Component API means the methods React gives a class: setState, forceUpdate, render. setState merges object state (shallow) and schedules render. forceUpdate re-renders without changing state — almost never needed; it’s a smell.
Hooks world: useState / useReducer replace setState. There is no forceUpdate. If a fresher recites forceUpdate as daily API, steer them back to ‘fix the state, don’t force paint’.
React Component API — output — class vs hooks. Interview: name setState, then say we use useState now.
Parent
│ props (read-only)
▼
Child → UIsetState vs useState. Avoid forceUpdate.