Your React App Doesn't Need All That JavaScript

This ad is not shown to multipass and full ticket holders
JSNation US
JSNation US 2026
November 16 - 19, 2026
New York, US & Online
Upcoming event
JSNation US 2026
JSNation US 2026
November 16 - 19, 2026. New York, US & Online
Bookmark
Rate this content
Sentry
Promoted
Code breaks, fix it faster

Crashes, slowdowns, regressions in prod. Seer by Sentry unifies traces, replays, errors, profiles to find root causes fast.

Get started

Should we be using a state management library to toggle dark mode? Do we really need a custom hook for opening an accordion? And how many event listeners is too many when animating on scroll?

React gives us an incredibly powerful way to build UI, but not every UI behaviour needs React level machinery.

In this talk, we’ll take a look at how to use HTML and CSS to build simpler alternatives to common interactive components such as accordions, modals, scroll transitions, carousels etc We’ll also take a look at the performance and accessibility benefits and real-life applications and use-cases of these components. 

The goal is to simplify how we handle content, display and animation using native browser features and leaving React to do what it's best at: everything else.

This talk has been presented at React Summit 2026, check out the latest edition of this React Conference.

Jemima Abu
Jemima Abu
27 min
16 Jun, 2026

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Using excessive JavaScript in React apps leads to unnecessary complexity, especially for simple tasks like dark mode toggling. Leveraging CSS for dark theme implementation in React can simplify architecture and avoid overengineering. Considering React's role in handling basic tasks like user preferences and theme switching. Exploring the efficiency of CSS in React components for theme switching and parent styling, showcasing simplicity and effectiveness. Highlighting the performance impact of JavaScript loading on page loading speed in slow internet scenarios. Emphasizing the benefits of semantic HTML for accessibility and accordion features. Discussing the importance of staying updated in web development and utilizing popular patterns. Exploring modal implementation simplicity and the ease of using popover for modals and scroll animations. Comparing JavaScript and CSS for scroll animations efficiency and main thread impact on scroll rendering. Showcasing innovative CSS features like carousel implementation, scroll buttons, and customizable select elements for web development.

1. Analyzing JavaScript Complexity in React

Short description:

Using excessive JavaScript in React apps feels unnecessarily complicated, e.g., for a simple dark mode toggle. React involves complex code for basic tasks like state management, persistence, global architecture, and optimization, leading to excessive rerenders due to state propagation on every update.

What if I told you you were using way too much JavaScript in your React applications? Hi, my name is Jemima. I'm a product engineer at CASE. I'm a Google Developer Expert at Microsoft MVP and a Certified Professional in Accessibility Core Competencies. Basically, what that means is I really like exploring the web and sharing the things that I've learned with other people. And one thing I have that constantly comes up in React, at least for me, is that it just keeps feeling a lot more complicated than it needs to be.

So how much JavaScript do you actually think a dark mode toggle needs? I mean, like a toggle that's just switching between light and dark mode. You're updating two colors and you're clicking a button, that's it, right? In React, it's a lot more code than you feel is necessary, or at least I feel is necessary. So let's break down what's happening here, right?

First, we have our states. If you're using React, you're going to have to work with states. If you're switching between basically anything, that's fine. That state, we're all used to And then we need persistence. So you want to store the user's preferences, right? So like next time they visit the page, they can see what they selected previous time. That's also great. We care about user experience. Amazing stuff. And then we need global architecture. If you're working with React, you need like something that's going to pass the same theme down to every single component and across multiple pages, right? So you need a context and you need your provider and you need everything that's handling your global stack management.

2. Optimizing React with CSS for Dark Theme

Short description:

React optimization using memo for theme toggling can lead to excessive rerenders and hydration flickers. Simplifying React architecture by leveraging CSS for dark theme implementation with a single checkbox avoids unnecessary complexity and overengineering.

And then because it's React, let's throw in some optimization, because why not, right? Because that means that we're making sure we're using memo. Why do we need to use memo to toggle the theme? It's either or. But that's the React way of doing things, right? To me, this feels way more complicated than it needs to be. I remember the first time I tried to build a theme switcher in React. And after having to download the state management library, I was like, this doesn't feel right. I think I'm doing something wrong. But all the articles were like, you're doing something right. But this is a very complicated method of doing things. And what is the issue that we face when we use something that's complicated to handle a very simple task? State propagation, right? So first, we are handling every single time the page is updated. Every time we change that state, that state needs to then be passed down to corresponding components. So that means every single time you click that toggle button, any other component that needs that theme is going to get updated too. This leads us to have lots of rerenders on our page. Because React operates on a virtual DOM, every time we make any change, it needs to basically update all the components that require that change. So we're causing rerenders. And then we also have the hydration flickers. This is when your page first loads. And let's say because you haven't necessarily kicked in your React yet, you're going to see a, let's say the user has saved dark mode, you're going to see a flash of light mode first and then dark mode is going to kick in. So to me, this feels like a lot for doing something so simple. It's kind of like, imagine having Optimus Prime and you're using him to flick a light switch in your house. It's like you have this giant overengineered, overpowered platform and you're using it to handle something super basic.

Well, what if I told you there was an easier way to do that? Thanks to modern web features and development, we no longer have to rely on overcomplicated React architecture to handle simple components. This is a simple CSS implementation that handles dark theme mode using just one checkbox. So let's break down what's happening here. First, we have our semantic checkbox in CSS and we're giving this a theme toggle. And then we have the has to the selector. This is what is doing all the work. Has to the selector is something that lets us style parent elements based on child elements. So basically what we're saying in this code is, if the theme toggle check box is checked, give the roots a new value of background black or text whites. This is what we're using to handle toggling the dark mode. In case of handling user preferences, we can also use the prefers color scheme.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Don't Solve Problems, Eliminate Them
React Advanced 2021React Advanced 2021
39 min
Don't Solve Problems, Eliminate Them
Top Content
Kent C. Dodds discusses the concept of problem elimination rather than just problem-solving. He introduces the idea of a problem tree and the importance of avoiding creating solutions prematurely. Kent uses examples like Tesla's electric engine and Remix framework to illustrate the benefits of problem elimination. He emphasizes the value of trade-offs and taking the easier path, as well as the need to constantly re-evaluate and change approaches to eliminate problems.
Jotai Atoms Are Just Functions
React Day Berlin 2022React Day Berlin 2022
22 min
Jotai Atoms Are Just Functions
Top Content
State management in React is a highly discussed topic with many libraries and solutions. Jotai is a new library based on atoms, which represent pieces of state. Atoms in Jotai are used to define state without holding values and can be used for global, semi-global, or local states. Jotai atoms are reusable definitions that are independent from React and can be used without React in an experimental library called Jotajsx.
Debugging JS
React Summit 2023React Summit 2023
24 min
Debugging JS
Top Content
Debugging JavaScript is a crucial skill that is often overlooked in the industry. It is important to understand the problem, reproduce the issue, and identify the root cause. Having a variety of debugging tools and techniques, such as console methods and graphical debuggers, is beneficial. Replay is a time-traveling debugger for JavaScript that allows users to record and inspect bugs. It works with Redux, plain React, and even minified code with the help of source maps.
The Epic Stack
React Summit US 2023React Summit US 2023
21 min
The Epic Stack
Top Content
This Talk introduces the Epic Stack, a project starter and reference for modern web development. It emphasizes that the choice of tools is not as important as we think and that any tool can be fine. The Epic Stack aims to provide a limited set of services and common use cases, with a focus on adaptability and ease of swapping out tools. It incorporates technologies like Remix, React, Fly to I.O, Grafana, and Sentry. The Epic Web Dev offers free materials and workshops to gain a solid understanding of the Epic Stack.
A Look Ahead at Web Development in 2025
JSNation US 2024JSNation US 2024
32 min
A Look Ahead at Web Development in 2025
Top Content
Today, Wes Boss introduces the new features of the web, including customizable select and temporal, a standardized API for working with dates, time, and duration. The current date API in JavaScript has some problems related to time zones and date manipulation. With the temporal API, you can create dates without a time zone, specify dates without a year, and create durations without being attached to a specific date. The API also provides features for finding the difference between two dates. Invokers is a declarative click handlers API that eliminates the need for JavaScript. Speculation API enables pre-rendering and pre-loading of pages, improving performance. The CSS Anchor API allows positioning elements based on another element's location. Web components are encapsulated, framework-agnostic, and easy to use, offering a standardized approach for building reusable UI components. Building media UI components, like video players, is made easier with web components like Shoelace. Transformers JS allows running AI models in JavaScript for tasks like emotion detection and background removal. Python doesn't run in the browser, but JavaScript does. Small AI models can be loaded and executed faster in the browser using technologies like WebGPU. Animate height auto transition using calc size. Apply starting styles to elements for smooth animations. Use Vue transition for CSS and JavaScript animations. Syntax website with Vue transition for smooth page transitions. CSS relative colors allow for lighter or darker shades. Scope CSS ensures styles only apply to specified div containers. Web primitives facilitate modern JavaScript code. You can create web requests and receive web responses using the same primitives on both the client and server. There are many new web standards that work everywhere and frameworks like Hano and Nitro are built upon them. The select and Popover elements are accessible by default. Most of the discussed features will be available in all browsers by 2025. The future of web development with AI is uncertain, but web developers should embrace AI tools to improve efficiency. Implicit CSS lazy loading depends on whether it's prefetching or pre-rendering. Wes Boss discusses the specific features he is excited about in web development, including starting style, calc auto, and allowed discrete. He shares his preferred way of staying informed on new web development discoveries, emphasizing the importance of being part of the community and keeping up with industry discussions. Wes also mentions reading W3C meeting notes and recommends following the Twitter account Intent2Ship to stay updated on upcoming CSS features. Lastly, he discusses the potential impact of the new Scope CSS feature on developers' management of styles.
The Rise of the AI Engineer
React Summit US 2023React Summit US 2023
30 min
The Rise of the AI Engineer
Top Content
The rise of AI engineers is driven by the demand for AI and the emergence of ML research and engineering organizations. Start-ups are leveraging AI through APIs, resulting in a time-to-market advantage. The future of AI engineering holds promising results, with a focus on AI UX and the role of AI agents. Equity in AI and the central problems of AI engineering require collective efforts to address. The day-to-day life of an AI engineer involves working on products or infrastructure and dealing with specialties and tools specific to the field.

Workshops on related topic

React, TypeScript, and TDD
React Advanced 2021React Advanced 2021
174 min
React, TypeScript, and TDD
Top Content
Featured Workshop
Paul Everitt
Paul Everitt
ReactJS is wildly popular and thus wildly supported. TypeScript is increasingly popular, and thus increasingly supported.

The two together? Not as much. Given that they both change quickly, it's hard to find accurate learning materials.

React+TypeScript, with JetBrains IDEs? That three-part combination is the topic of this series. We'll show a little about a lot. Meaning, the key steps to getting productive, in the IDE, for React projects using TypeScript. Along the way we'll show test-driven development and emphasize tips-and-tricks in the IDE.
Web3 Workshop - Building Your First Dapp
React Advanced 2021React Advanced 2021
145 min
Web3 Workshop - Building Your First Dapp
Top Content
Featured Workshop
Nader Dabit
Nader Dabit
In this workshop, you'll learn how to build your first full stack dapp on the Ethereum blockchain, reading and writing data to the network, and connecting a front end application to the contract you've deployed. By the end of the workshop, you'll understand how to set up a full stack development environment, run a local node, and interact with any smart contract using React, HardHat, and Ethers.js.
Remix Fundamentals
React Summit 2022React Summit 2022
136 min
Remix Fundamentals
Top Content
Workshop
Kent C. Dodds
Kent C. Dodds
Building modern web applications is riddled with complexity And that's only if you bother to deal with the problems
Tired of wiring up onSubmit to backend APIs and making sure your client-side cache stays up-to-date? Wouldn't it be cool to be able to use the global nature of CSS to your benefit, rather than find tools or conventions to avoid or work around it? And how would you like nested layouts with intelligent and performance optimized data management that just works™?
Remix solves some of these problems, and completely eliminates the rest. You don't even have to think about server cache management or global CSS namespace clashes. It's not that Remix has APIs to avoid these problems, they simply don't exist when you're using Remix. Oh, and you don't need that huge complex graphql client when you're using Remix. They've got you covered. Ready to build faster apps faster?
At the end of this workshop, you'll know how to:- Create Remix Routes- Style Remix applications- Load data in Remix loaders- Mutate data with forms and actions
Vue3: Modern Frontend App Development
Vue.js London Live 2021Vue.js London Live 2021
169 min
Vue3: Modern Frontend App Development
Top Content
Workshop
Mikhail Kuznetsov
Mikhail Kuznetsov
The Vue3 has been released in mid-2020. Besides many improvements and optimizations, the main feature of Vue3 brings is the Composition API – a new way to write and reuse reactive code. Let's learn more about how to use Composition API efficiently.

Besides core Vue3 features we'll explain examples of how to use popular libraries with Vue3.

Table of contents:
- Introduction to Vue3
- Composition API
- Core libraries
- Vue3 ecosystem

Prerequisites:
IDE of choice (Inellij or VSC) installed
Nodejs + NPM
Developing Dynamic Blogs with SvelteKit & Storyblok: A Hands-on Workshop
JSNation 2023JSNation 2023
174 min
Developing Dynamic Blogs with SvelteKit & Storyblok: A Hands-on Workshop
Top Content
WorkshopFree
Alba Silvente Fuentes
Roberto Butti
2 authors
This SvelteKit workshop explores the integration of 3rd party services, such as Storyblok, in a SvelteKit project. Participants will learn how to create a SvelteKit project, leverage Svelte components, and connect to external APIs. The workshop covers important concepts including SSR, CSR, static site generation, and deploying the application using adapters. By the end of the workshop, attendees will have a solid understanding of building SvelteKit applications with API integrations and be prepared for deployment.
0 to Auth in an hour with ReactJS
React Summit 2023React Summit 2023
56 min
0 to Auth in an hour with ReactJS
Top Content
WorkshopFree
Kevin Gao
Kevin Gao
Passwordless authentication may seem complex, but it is simple to add it to any app using the right tool. There are multiple alternatives that are much better than passwords to identify and authenticate your users - including SSO, SAML, OAuth, Magic Links, One-Time Passwords, and Authenticator Apps.
While addressing security aspects and avoiding common pitfalls, we will enhance a full-stack JS application (Node.js backend + React frontend) to authenticate users with OAuth (social login) and One Time Passwords (email), including:- User authentication - Managing user interactions, returning session / refresh JWTs- Session management and validation - Storing the session securely for subsequent client requests, validating / refreshing sessions- Basic Authorization - extracting and validating claims from the session token JWT and handling authorization in backend flows
At the end of the workshop, we will also touch other approaches of authentication implementation with Descope - using frontend or backend SDKs.