Class Components in React
A class component extends React.Component, keeps data in this.state, updates with this.setState, and draws in render(). Lifecycle methods: componentDidMount, componentDidUpdate, componentWillUnmount. You will still read this in older codebases.
Map to hooks: state → useState, didMount/didUpdate/willUnmount → useEffect. Don’t start a new screen as a class unless the team’s file already is one. Interview: show you can read a class, then say you’d rewrite it as a function.
Class Components in React — on screen — button 0, click → 1. Class uses this.setState. Today we write useState instead.
Parent
│ props (read-only)
▼
Child → UIRead class. Prefer hooks for new code.