We've moved several of our more interactive client dashboards onto React this year, and the question from developers newer to the library is almost always the same: what actually makes React different from just writing JavaScript that updates the DOM directly? The honest answer is a shift in mental model - instead of imperatively describing each DOM change, you declaratively describe what the interface should look like for a given state, and React handles turning one into the other.
Components are just functions
function ProjectCard({ title, year }) {
return (
<div className="card">
<h3>{title}</h3>
<span>{year}</span>
</div>
);
}
That's JSX - HTML-like syntax inside JavaScript, compiled by Babel into regular React.createElement calls. It looks unusual at first and becomes natural within a day or two of actually writing it.
Props flow down, one direction only
<ProjectCard title="Pranta Tech Site Rebuild" year="2019" />
Props are how a parent component passes data to a child - read-only from the child's side, always flowing one direction. That one constraint, more than any other, is what keeps a growing React app's data flow traceable instead of turning into a tangle of who-changed-what-when.
State is what makes a component interactive
import { useState } from 'react';
function Counter() {
const [count, setCount] = useState(0);
return (
<button onClick={() => setCount(count + 1)}>
Clicked {count} times
</button>
);
}
The newly released Hooks API - useState chief among them - lets a plain function component hold and update its own state, something that previously required writing a class. Calling setCount doesn't just update a variable; it tells React to re-render the component with the new value, and React works out the minimal set of real DOM changes needed to reflect it.
Why the indirection is worth it
Directly manipulating the DOM works fine for a handful of interactions. It stops working cleanly once dozens of pieces of UI need to stay in sync with changing data - a cart total, a filtered list, a live validation message. React's declarative model and its virtual-DOM diffing mean you describe the end state and let the library work out the efficient path to it, instead of hand-tracking every intermediate step yourself.
You stop asking "what do I need to change?" and start asking "what should this look like right now?"
Where new React developers usually get stuck
Mutating state directly - count++ instead of setCount(count + 1) - is the single most common beginner mistake, because it silently fails to trigger a re-render at all. React compares references to decide whether to update, so state needs to be replaced with a new value, never edited in place, including for objects and arrays.
// Wrong - mutates the existing array, React won't notice
items.push(newItem); setItems(items);
// Right - creates a new array reference
setItems([...items, newItem]);
useEffect is powerful and easy to misuse
The dependency array controls when an effect re-runs, and getting it wrong is behind most "why does this run twice" or "why doesn't this update" bugs newer developers hit. The rule of thumb that avoids most of the pain: include every value the effect reads from component scope, and if that starts feeling unwieldy, it's usually a sign the logic belongs in an event handler instead of an effect.