React vs jQuery: Understanding the Differences and Benefits

Comparing React and jQuery is a bit like comparing a power drill with a full workshop. Both help you build things, but they are made for very different jobs. Most “React vs jQuery” articles list features side by side. We think it is more useful to build the same small feature with both and see how differently they think.
By the end of this article you will understand what each one is really for, why mixing them causes trouble, and which one to choose for your next project.
React vs jQuery: the short version
- jQuery is a small library that makes it easier to find elements on a page and change them. You tell the browser what to do, step by step.
- React is a library for building whole user interfaces from components. You describe what the page should look like for the current data, and React works out the changes for you.
That difference, “do this step” versus “it should look like this”, is the heart of everything below.
Let us build the same feature twice
Our feature: a simple shopping list. You type an item, click Add, and it appears in the list. Each item has a remove button, and a counter shows how many items there are.
The jQuery version
<input id="item" placeholder="Add an item">
<button id="add">Add</button>
<p><span id="count">0</span> items</p>
<ul id="list"></ul>
<script>
$('#add').on('click', function () {
const text = $('#item').val().trim();
if (!text) return;
const $li = $('<li>').text(text);
const $remove = $('<button>').text('Remove');
$li.append(' ', $remove);
$('#list').append($li);
$('#item').val('');
$('#count').text($('#list li').length);
});
$('#list').on('click', 'button', function () {
$(this).closest('li').remove();
$('#count').text($('#list li').length);
});
</script>
This is clear and short. Each line is an instruction: read the input, create a list item, add it, clear the input, update the counter. Notice something, though: we had to remember to update the counter in two places. Add a third feature, like “clear all”, and you need to remember it a third time. Forget once, and the counter shows the wrong number.
The React version
import { useState } from 'react';
function ShoppingList() {
const [items, setItems] = useState([]);
const [text, setText] = useState('');
function addItem() {
if (!text.trim()) return;
setItems([...items, { id: Date.now(), name: text.trim() }]);
setText('');
}
function removeItem(id) {
setItems(items.filter(item => item.id !== id));
}
return (
<div>
<input value={text} onChange={e => setText(e.target.value)} placeholder="Add an item" />
<button onClick={addItem}>Add</button>
<p>{items.length} items</p>
<ul>
{items.map(item => (
<li key={item.id}>
{item.name} <button onClick={() => removeItem(item.id)}>Remove</button>
</li>
))}
</ul>
</div>
);
}
It is a little longer, and it needs a build setup. But look at what is missing: we never update the counter or the list by hand. We only change the data (items). The returned markup says “the counter shows the number of items, and the list shows each item”. When the data changes, React updates the page to match.
Add “clear all”? It is one line: setItems([]). The counter and list update themselves. That is the real benefit of React, and it grows as the interface gets bigger.
React vs jQuery: the key differences
| jQuery | React | |
|---|---|---|
| Style of thinking | Step by step instructions (imperative) | Describe the result for the current data (declarative) |
| Where the “truth” lives | In the page itself | In JavaScript data (state) |
| Code organisation | Up to you, often one big file | Reusable components |
| Setup | Add one script tag | Usually a build tool like Vite or a framework like Next.js |
| Best for | Adding small interactions to existing pages | Interactive apps and complex interfaces |
| Learning curve | Gentle | Steeper: JSX, state, hooks, tooling |
| Typical use today | WordPress themes, older sites | Dashboards, web apps, modern front ends |
Where jQuery still makes sense
- Small enhancements on a normal website. A mobile menu toggle, an FAQ accordion, a smooth scroll. Though honestly, plain JavaScript handles these just as well today, as we explain in our article on whether jQuery is dead.
- WordPress themes and plugins. WordPress includes jQuery, and many plugins rely on it, so using it there costs nothing extra.
- Maintaining existing projects. If a site already runs on jQuery and works, a full rewrite in React is rarely worth the cost.
Where React makes sense
- Apps with lots of changing data. Dashboards, booking systems, chat apps, admin panels, anything where many parts of the screen depend on the same data.
- Interfaces built by a team. Components make it easy to split work and reuse pieces like buttons, forms and modals.
- Long term projects. As features pile up, React’s structure keeps the code easier to change than a large jQuery file.
Why you should not mix them
It is tempting to add a jQuery plugin to a React app, or to use jQuery to “quickly” change something React rendered. Avoid this. React keeps its own picture of what the page looks like. If jQuery changes the page behind React’s back, React does not know, and the next update can undo the change or produce strange bugs.
If you must use a jQuery based plugin inside React, keep it inside one component, give it its own element to control, and set it up and clean it up in a useEffect hook. Better still, look for a React version of the same plugin. There almost always is one.
React vs jQuery performance: which is faster?
This question comes up a lot, and the answer depends on the job:
- For a simple page with a few interactions, plain JavaScript or jQuery loads less code, so the page is ready sooner.
- For a complex app, React’s way of batching updates keeps the interface smooth and predictable as it grows.
- Badly written code is slow in either one. Choosing the right tool for the job matters more than the tool’s raw speed.
Which one should you learn?
If you are starting out, our recommended order is:
- Plain JavaScript, because both libraries are built on it. Our guide to JavaScript for web development is a good starting point.
- Enough jQuery to read it, if you will work with WordPress or older sites.
- React, when you want to build apps or work on modern front end teams.
Final thoughts on React vs jQuery
React did not replace jQuery so much as move into a different neighbourhood. jQuery helps you add behaviour to pages. React helps you build interfaces where the page is a reflection of your data. Once you understand that difference, choosing between them becomes easy: small touches on a website point to plain JavaScript or jQuery, and anything that feels like an app points to React.
