React is a JavaScript library for building user interfaces out of reusable components, where state changes trigger re-renders that React efficiently reconciles through its virtual DOM. Hooks like useState and useEffect let functional components manage data and side effects without writing class-based code. Understanding how components, props, state, and hooks interact is the foundation for almost every React interview question you'll face.
React shows up in job postings, codebases, and architecture discussions across nearly every enterprise IT shop, but the terminology around it gets muddled fast. Teams conflate "component" with "class," confuse state with props, and treat hooks as magic rather than a coherent system. This article walks through what React actually is, how its rendering model works under the hood, how hooks replaced older patterns, and what the architecture means practically for teams building and maintaining production applications.
React is a UI library, not a framework. That distinction matters: React only handles rendering views in response to data changes. It doesn't dictate routing, data fetching, or project structure the way a full framework would — you assemble those pieces yourself or adopt a meta-framework built on top of it.
The core idea is component-based architecture. Instead of building one monolithic page, you break the UI into small, self-contained pieces — a button, a card, a navigation bar — each responsible for its own markup, logic, and styling. Those pieces compose into larger screens.
JSX is the syntax extension that lets you write HTML-like markup directly inside JavaScript. It looks like templating, but it isn't — it's syntactic sugar that compiles down to plain JavaScript function calls describing what the UI should look like.
This is where the real mindset shift happens. Vanilla DOM manipulation is imperative: you write step-by-step instructions telling the browser exactly how to find an element and mutate it. React is declarative: you describe what the UI should look like for a given state, and React figures out how to get the DOM there. That shift is often the hardest part for developers coming from jQuery-style scripting, and it's conceptually similar to the broader shift developers experience when they move between frontend vs backend roles and have to reason about state and rendering differently than they do about request/response cycles.
Modern React is built almost entirely around functional components — plain JavaScript functions that return JSX. Class components still exist in older codebases, but new development overwhelmingly favors functions paired with hooks.
Props (short for properties) are how data flows into a component. They're passed down from a parent component as arguments, and the component reads them to decide what to render. This flow is intentionally one-directional — data moves top-down, never sideways or upward without explicit callbacks.
Under the hood, JSX isn't HTML at all. Every JSX tag compiles to a call to React.createElement, which returns a plain JavaScript object describing the element, its props, and its children. The browser never sees JSX directly — a build step transforms it first.
A few composition rules keep components predictable and reusable:
Start your React.js journey — get a free 1:1 consultation.
What do these skills pay? Check the IT Salary Calculator → salaries by role, country and experience.
State is data that a component owns and can change over time — form input values, toggle flags, fetched API results. Unlike props, state is local to the component (unless deliberately shared) and triggers a re-render whenever it's updated.
Calling useState's setter function doesn't mutate a variable in place. It tells React "this component's data has changed, please re-evaluate it." React then re-runs the component function, producing a new description of the UI.
That new description gets compared against the previous one using the virtual DOM — a lightweight in-memory representation of the UI tree. React runs a diffing/reconciliation algorithm to find exactly what changed, then applies only those minimal updates to the real DOM.
This matters because direct DOM manipulation is expensive. By batching comparisons in memory first, React avoids unnecessary layout recalculations and repaints, which is a major reason React-based UIs stay responsive even as they grow complex.
Batching takes this a step further. When multiple state updates happen within the same event handler, React groups them into a single re-render pass rather than re-rendering after each individual change. This avoids redundant work and keeps the UI consistent mid-update.
Think of React less as a tool that updates your page and more as a tool that redraws it from scratch every time — the "magic" is simply that it's extremely good at figuring out which parts of that redraw you never actually see.
Hooks are functions that let functional components tap into features — state, lifecycle behavior, context — that were previously only available in class components. They were introduced to solve a real problem: class components scattered related logic across multiple lifecycle methods, making it hard to follow and reuse.
The most common hooks you'll use daily:
Hooks come with two firm rules: only call them at the top level of a component (never inside loops, conditions, or nested functions), and only call them from React function components or other custom hooks. Breaking these rules confuses React's internal bookkeeping about which hook belongs to which state slot.
Hooks replaced class lifecycle methods like componentDidMount and componentDidUpdate because they let you group related logic together by concern rather than by lifecycle phase, and they make that logic reusable across components without the ceremony of inheritance or higher-order components.
For engineering leaders, React's appeal isn't aesthetic — it's operational. Component reuse means a design system built once gets consumed across dozens of screens, cutting duplicate work and visual inconsistency.
Predictable state management — especially once a team adopts consistent patterns for where state lives — makes bugs easier to trace, because data flows in one direction instead of being mutated from arbitrary places.
React's ecosystem maturity is also a practical asset. Routing libraries, state management tools, testing utilities, and meta-frameworks built on React have had years to stabilize, which reduces the risk of betting a product on unproven tooling.
There's a hiring dimension too: React's large adoption means a correspondingly large talent pool, which shortens hiring cycles and lowers onboarding friction compared to niche or in-house frameworks.
At scale, all of this feeds into maintainability. Teams that enforce clear component boundaries and consistent state patterns find it dramatically easier to onboard new engineers into a years-old codebase than teams working with tangled, ad hoc DOM manipulation.
Composition is the default way to build complex UI from simple pieces — nesting a Card component inside a List, which sits inside a Page. Favor passing components as children or props over building deeply configurable single components with dozens of flags.
Lifting state up solves the common problem of two sibling components needing to share data. Instead of duplicating state in both, move it to their nearest common parent and pass it down as props along with update handlers.
When state needs to reach many components at different depths, Context avoids the tedium of passing props through every intermediate layer — useful for theming, authentication state, or locale settings, though it's not a full replacement for dedicated state management in very large apps.
Custom hooks let you extract reusable stateful logic — a useFetch hook, a useForm hook — out of components entirely, so multiple components can share behavior without duplicating code or resorting to inheritance.
On file organization, most teams converge on one of two approaches:
A handful of misunderstandings come up repeatedly, both in day-to-day development and in technical interviews:
Component-level testing typically combines a test runner with a library that renders components in a simulated DOM and lets you assert on rendered output and user interactions, rather than testing internal implementation details.
For full user-flow verification, teams layer in automated browser testing to confirm that real browser behavior — navigation, form submission, visual rendering — matches expectations across environments.
Build tooling compiles JSX and modern JavaScript down into browser-compatible bundles, handling code splitting and asset optimization so production bundles stay lean.
Shipping reliably depends on continuous integration pipelines that run tests and builds automatically on every change, catching regressions before they reach users.
Deployment itself increasingly relies on containerized deployment, giving teams consistent, reproducible environments from a developer's machine through to production servers. Teams building AI-assisted features into React front ends often pair this foundation with structured upskilling, such as a Generative AI training programme, to bridge UI engineering with model-backed functionality.
React is a library, not a full framework. It focuses specifically on building UI components and managing rendering; routing, state management at scale, and data fetching are handled by separate libraries like React Router or Redux, which is why React setups vary more between companies than framework-based alternatives.
Props are data passed into a component from its parent and are read-only inside that component. State is data a component manages internally and can change over time, triggering a re-render. A common interview question is explaining that props flow down while state is local and mutable through setter functions.
The virtual DOM is a lightweight in-memory representation of the actual DOM. When state changes, React builds a new virtual DOM tree, diffs it against the previous one, and only applies the minimal set of real DOM updates needed. This reconciliation process is why React apps can update frequently without expensive full-page re-renders.
useState stores and updates a value that affects what's rendered, like form input or a toggle. useEffect handles side effects that happen after render, like fetching data, subscribing to events, or syncing with external systems. A frequent mistake is using useEffect to derive values that could simply be computed during render.
Prop drilling happens when you pass props through several layers of components that don't use the data themselves, just to reach a deeply nested child. You avoid it with the Context API for shared state, or by restructuring components to colocate state closer to where it's used, or with a state management library for complex apps.
Expect questions on the difference between state and props, how hooks replaced lifecycle methods, what the virtual DOM does, why keys matter in lists, how useEffect's dependency array works, and how to lift state up between sibling components. Interviewers often follow up by asking you to debug a snippet with a stale closure or missing dependency.
Browse our upcoming batches — live, instructor-led, delivered on Orbit.