Frontend
React
A declarative, component-based library that describes the UI as a function of state and reconciles changes through a virtual DOM. A huge ecosystem and reusable components make it the default for complex interfaces. Mind the footguns — needless re-renders, stale closures and effect dependencies — and it typically pairs with a router or a framework like Next.js for routing and SSR.
Purpose
React is a declarative UI library: you describe what the interface should look like as a function of state, and React reconciles the real DOM to match when state changes. This removes the error-prone choreography of manual DOM updates that jQuery-era code drowned in.
When to Use It
It is the default choice for complex, stateful interfaces — dashboards, editors, multi-step flows — and its component model makes design systems and reuse natural. The ecosystem (and hiring pool) is the largest in frontend.
For mostly-static content sites, a lighter approach or plain HTML often loads faster and costs less complexity.
Trade-offs
The flexibility hides footguns: needless re-renders from unstable props, stale closures in hooks, and effect dependency arrays that silently miss updates. React alone handles rendering — routing, data fetching and server-side rendering typically come from a router or a framework such as Next.js.
Implementation
Build small components that take props and own minimal state; lift shared state up or reach for context/a store when prop-drilling hurts. Follow the rules of hooks, give lists stable keys, and use useEffect only for true external synchronisation — not for deriving state. Measure with the React DevTools profiler before optimising.