SMRTR ProgrammingAug 31, 2026Daily.dev

Your React app doesn’t need all that JavaScript

Your React app doesn’t need all that JavaScript

SMRTR summary

A dark mode toggle that takes four lines of JavaScript in a browser can balloon into dozens of lines of React code, complete with state hooks, context providers, and flickering load screens. That tension sits at the heart of a growing conversation among web developers: are we reaching for React when the browser itself already has the answer?

The argument is that six common UI patterns, including dark mode, accordions, modals, carousels, custom dropdowns, and scroll animations, can be built with native HTML and CSS features that are either already widely supported or rapidly becoming so.

A checkbox paired with CSS's `:has()` selector can toggle a dark theme without a single React re-render. Two HTML elements, `` and ``, replace an entire accordion component. The browser's `` element handles focus trapping, backdrop, and keyboard behavior automatically.

The takeaway is not to abandon JavaScript entirely, but to stop defaulting to complexity. Start with the simplest browser primitive that works, and reach for React only when the interaction genuinely demands it.

SMRTR provides this summary for quick context. The original article belongs to Daily.dev.

Read the original article
SMRTR Programming

Get the next batch of curated stories in your inbox.

This archive is built from SMRTR newsletter stories. Subscribe for hand-picked stories without the extra noise.

Related Stories

Browse Programming