HTMX vs React
Last updated 2026-07-25What's new
- OpenAI's Codex (a tool that helps write and edit code) can now organize vast amounts of information, like emails and Slack messages, making it easier to track important tasks.
- You can control Codex by voice using a foot pedal, allowing you to give commands hands-free, like fixing code or sending messages.
- "Appshots" is a new feature in Codex that lets you take snapshots of your work with a simple keyboard shortcut, making it easy to save and share progress.
- Codex can also review and improve code based on past feedback from teammates, helping to maintain consistent coding styles and catch errors.
- AI tools (computer programs that use artificial intelligence) often struggle with large amounts of information, as performance can degrade after using just 25% of their context window (the amount of data they can process at once).
- Documentation (instruction manuals) for AI tools is often written for humans, not AI, making it difficult for AI to understand and use effectively without additional context engines (tools that help AI understand information better).
- In the future, AI tools may focus on creating a "fluency mode" (a smooth, easy-to-use experience) rather than a "friction mode" (making it hard for users to switch to a different tool), with skills (specialized abilities) playing a key role in this shift.
- When evaluating AI platforms, users often consider factors like security, data governance (how data is managed and protected), and integration (how well it works with other systems) capabilities.
- Code is becoming a primary way to create and communicate content, like videos, websites, or product updates, using tools like React and Remotion (a video creation tool using code).
- In the past, creating content required hiring experts or expensive software engineers, but now AI tools like Claude (an AI assistant) can help generate high-quality content quickly and cheaply.
- With AI, people with an engineering mindset can create various assets, such as videos, documentation, or websites, by understanding and using these AI systems effectively.
- Developers are shifting from coding to designing systems, using AI tools like Claude (a chatbot assistant) and GitHub Copilot (a code suggestion tool) to help with tasks.
- AI tools have evolved to the point where they can handle many coding tasks, allowing developers to focus on higher-level design and management.
- A new workflow is proposed, starting with a command-line interface (CLI, a text-based way to interact with your computer) to manage tasks like issues and pull requests (PRs, a way to contribute to a project), then moving to an editor for more detailed work.
- Developers are now using AI agents (automated tools that can perform tasks) to build and fix features, often using natural language prompts instead of writing code directly.
- SpaceX released Grock 4.5, a new AI model designed for coding tasks, offering a strong balance of intelligence, speed, and cost efficiency (price).
- Grock 4.5 is highly token efficient (uses fewer "words" to express ideas), making it great for everyday coding and cheaper than many competitors.
- It performs well on benchmarks, scoring high on coding and engineering tasks, and is set to get even better with a upcoming upgrade to a 1 million token context window.
- Grock 4.5 is available through Grock Build, their API, and Cursor (a code editor), but not yet in the EU, with a expected launch in mid-July.
Key points
What it is
- HTMX (a small JavaScript library) lets you build web apps by adding attributes directly to HTML, swapping raw HTML chunks from the server.
- React (a larger JavaScript framework) is designed for "deeply interactive client applications" like Google Sheets or real-time maps.
How to use it
- Use HTMX for most web apps like forms, dashboards, and content management by adding attributes to HTML elements.
- Use React for complex, interactive apps with thousands of interdependent widgets reacting instantly, like spreadsheets or drag-in-real-time maps.
Watch out for
- HTMX is not a replacement for all web apps, especially those requiring deep interactivity.
- React can be more complex for AI to manage due to its need to keep state twice (server and browser) and write an API to sync them.
Tools named
- HTMX (a small JavaScript library for building web apps), React (a JavaScript framework for interactive client applications)
Lesson 1: What is HTMX vs React and why it matters
HTMX is a small JavaScript library (about 16 kilobytes) that lets you build web apps by adding attributes directly to HTML. Instead of sending JSON data back and forth, HTMX swaps in raw HTML chunks from the server. React is a much larger framework (around 45 kilobytes just for its core) designed for "deeply interactive client applications" — things like Google Sheets or a map you drag in real time.
For AI development, the choice matters because AI coding agents are good at writing front-end code, especially React. But HTMX keeps a single copy of your app's state on the server, while React keeps state twice (once on the server and once in the browser), forcing you to write an API just to sync them. This mismatch makes React more complex for AI to manage. One real company, Contact, rewrote their React app in HTMX and reduced code by 67%, slashed JavaScript dependencies from 255 to nine, and cut build times by nearly 90%.
However, HTMX is not a replacement for everything. It is for "the other 90% of the web" — forms, dashboards, content management. AI agents can write either, but the decision depends on whether you or the agent is doing the writing. If your AI agent is handling the code, HTMX's simplicity means fewer files and less state to track. For apps with "thousands of interdependent widgets reacting instantly," stick with React. For everything else, HTMX removes a staggering amount of complexity.
Sources
- 2026-07-05 — HTMX vs React The honest verdict (with receipts)!
- 2026-06-03 — Beyond Components Designing Generative UI for MCP Apps Ruben Casas, Postman
- 2026-05-03 — Remotion vs HyperFrames Without Coding Skills!
- 2026-07-06 — How to Get Ahead of 99 of People In the Age of AI - 50 Tips
- 2026-06-13 — Minimax M3 Coder IS INCREDIBLE! Opensource Local 247 AI OS!
- 2026-05-07 — Vibe Engineering Effect Apps Michael Arnaldi, Effectful
- 2026-06-05 — Its starting
Lesson 2: How to use HTMX vs React: step-by-step
How to Use HTMX vs React Step by Step with Examples
HTMX is a tiny 16-kilobyte library that lets you add modern interactions to HTML by using attributes directly in your markup. For example, to load more content when a user clicks a button, you write `<button hx-get="/more" hx-target="#content">Load More</button>`. That single attribute fires an HTTP request, the server sends back a chunk of HTML, and HTMX swaps it into the `#content` div. That’s it. React would require you to create a component, manage state (data that changes over time), write a fetch call, parse JSON, and trigger a re-render. HTMX cuts all that out.
React excels when you have a deeply interactive client application—like a real-time spreadsheet or a drag-and-drop map. It shines with thousands of interdependent widgets reacting instantly. But for the other 90% of the web—forms, dashboards, content CRUD—HTMX is a simpler choice. It keeps a single copy of state on the server and sends HTML, while React forces you to keep state twice (server and browser) and write an API to sync them.
One real company, Contact, rewrote their React app in HTMX. They cut code by 67%, dropped JavaScript dependencies from 255 to nine, and reduced build times by nearly 90%. The honest verdict: if you are building complex client-side apps, reach for React. For most everything else, HTMX gives you a leaner, faster path.
Sources
- 2026-07-05 — HTMX vs React The honest verdict (with receipts)!
- 2026-07-06 — How to Get Ahead of 99 of People In the Age of AI - 50 Tips
- 2026-05-03 — Remotion vs HyperFrames Without Coding Skills!
- 2026-05-11 — How to Build Mobile Apps with Claude Code Full Course (2026)
- 2026-05-18 — Is Anthropic Inventing Problems to Sell More Tokens
- 2026-06-28 — 41 to 3 How I fixed Claude's Biggest Coding Problem
Lesson 3: Best practices and pitfalls
Reach for React when building a deeply interactive client application like a spreadsheet (Google Sheets), a drag-in-real-time map, or anything offline with thousands of interdependent widgets reacting instantly. That is React's home turf. For the other 90% of the web—forms, dashboards, content CRUD—use HTMX (a 16-kilobyte library that lets HTML talk directly to the server). HTMX revives real hypermedia by sending HTML instead of juggling JSON, so you keep a single copy of state on the server. An entire category of bugs disappears.
A common pitfall with React is keeping state twice (once on the server, once in the browser) and writing an API forever to sync them. HTMX avoids this via a simple three-word loop: request-response-swap. You add an attribute like hx-get or hx-post to an element, it fires an HTTP request, the server sends back a chunk of HTML, and HTMX drops it into the page. Locality of behavior (seeing what an element does right in the markup) means no hunting through a dozen files to trace one click.
The honest verdict: HTMX is not React's funeral. But the receipts are strong. Contact rewrote their React app in HTMX and got 67% less code, a drop from 255 to 9 JavaScript dependencies, and build times cut by nearly 90%. Best practice: use HTMX for most apps and sprinkle small tools where needed instead of one giant framework. Adopt React only when the app demands deep interactivity.