So, Don't Overreact But... I'm So Over React
Besworks

Besworks @besworks

About: Web Component Evangelist ☕ ko-fi.com/besworks

Location:
Canada
Joined:
Apr 3, 2022

So, Don't Overreact But... I'm So Over React

Publish Date: May 5
74 139

More accurately, I’m over everyone treating it like the only answer.


I'm a devout supporter of Web Components and have been preaching the gospel of web standards for decades. That guy you always hear muttering "Why use a library when the browser gives you everything you need?"

I have lived through five versions of HTML (2,3,4,XHTML,5) and watched as libraries like jQuery and frameworks like Angular have come and gone from the spotlight. And I'm here now to tell you that you never NEEDED any of them and this has never been more true than it is today.

Custom Elements, Shadow DOM, HTML Templates. These tools provide everything we need to build robust, modern components without relying on heavy abstractions. But still, in 2025, the web development world clings tightly to libraries like React.

The Standard Approach

I'll admit that React played a huge role in shaping modern front-end development. Its component model, reactive updates, and rich ecosystem were groundbreaking when they emerged. But React’s reliance on third-party extensions like JSX, its synthetic event system, performance overhead, and tendency to blur styling and logic inside components all fall short of the standards set for the web.

Web Components — by contrast — are a core part of the web standards, embrace the browser’s strengths, benefit from baked in optimizations, and promote separation of concerns. All without the need for build pipelines or runtime libraries. You’re working with the platform, not against it.

Universal by Design

Perhaps the most underappreciated strength of Web Components is their inherent interoperability. Build a standards-compliant component, and you can drop it into any toolkit. Whether you’re using Vue, Svelte, whatever the flavor-of-the-year framework is, or just static HTML, Web Components fit right in.

With React, moving components between frameworks often means rewrites, dependency tangles, and awkward integration. Why lock your work into a single ecosystem when the browser already provides a universal language? And don't even get me started on stateful rendering in an environment that was intentionally designed to be stateless.

Well designed Custom Elements can be used completely declaratively, blend seamlessly into Server Side Rendering, can be styled through standard CSS, are naturally encapsulated, and the list of capabilities goes on and on and on...

The State of Things

I’m not here to say React is evil or useless. It’s a mature, powerful tool with plenty of successful projects under its belt. But in 2025, when developers continue to reach for it by default, that seems more like a bad habit — a reflex that hasn’t caught up to the evolution of the platform.

For those of us who’ve been building with Web Components for years, the continued use of vendor-specific solutions feels increasingly out of sync with the realities of the web platform. Most of the problems that React once solved have been addressed at the platform level long ago. Web Components have been mature for years. It's time to stop solving today's problems with yesterday’s tools. Imagine if we never stopped using tables for layout just because "That's how we've always done it".

Building for The Future

Obviously we all use the tools we know and trust. But sometimes we need to challenge ourselves to re-examine whether those tools are still the best fit for today’s (and tomorrow’s) needs. That's exactly why the standards exist and continue to evolve. And exactly why I will stick with them as I always have. Because one day, React will fade into obscurity just like jQuery while Web Components will live on as long as the web itself.

Comments 139 total

  • José Pablo Ramírez Vargas
    José Pablo Ramírez VargasMay 5, 2025

    I'm no expert, but experts like Ryan Carniato (creator of SolidJS) disagrees with your conclusion.

    Furthermore, it is the general consensus that declarative programming is better than imperative programming, and this is why frameworks and libraries like React, SolidJS, Svelte, Vue, etc. spring to life.

    • Besworks
      BesworksMay 5, 2025

      I am aware of the opinions of framework creators on this subject and I have not seen a single argument that has swayed my own opinion. Nothing about Web Components precludes you from using a framework. The choice to use one is completely a matter of preference and suitability for the current project. Most examples of "why Web Components are bad" usually boil down to not using them to their full potential or using them to solve problems they were never intended to solve.

      I don't get your point about declarative vs imperative. As I mentioned in the article, Custom Elements can be used completely declaratively. Furthermore, there is nothing imperative about their use at all. They are not required in any way but are simply a tool to make Web Development easier.

      The real problem I was trying to point out is that companies treat React as imperative. Like nothing else could do the job. Which is simply not true. The same kind of sentiments existed about jQuery. It was almost impossible to convince an execubot that a web app could be built without it, even though plenty of developers did so every day. And look how that went in the long run.

      We must look to the past to design the future. And the past has shown us the same patterns over and over again. It would be crazy to dismiss this knowledge. The Web Components standard wasn't haphazardly designed. It was carefully forged to provide maximum benefit with minimal disruption. No one is forcing you or anyone to change their habits, but true growth requires stepping out of your comfort zone to explore alternatives.

      • José Pablo Ramírez Vargas
        José Pablo Ramírez VargasMay 5, 2025

        Many truths indeed. Product owners at companies are obsessed with React or Angular, and while they usually pull "popularity", they always shield behind "they are backed by Meta and Google". Like throwing money is all that is ever needed.

        So Yes!, I fully agree that people need to see that money and popularity are not the fundamental base conditions for frameworks/libraries to achieve, and instead they should be the consequences of the really important features.

        As for web components, like I said, I'm no expert. I wanted to share the fact that people that I regard as "experts" contrary the conclusion of this article. More than that, I cannot debate. I have never done web components myself.

        I do agree, though, that web components can use frameworks, merely because I know Svelte can produce web components. Still, as much as I LOVE Svelte, I have never done a web component, not even for "fun". So once, more, I defer to the experts here.

        Cheers.

        • Besworks
          BesworksMay 5, 2025

          Thank you for engaging on this topic. You are exactly the kind of audience I am trying to reach. Experienced developers who may not have given Web Components a chance due to negative opinions about them. I would encourage you to give them a try, see what all the fuss is all about, and draw your own conclusions.

      • Rense Bakker
        Rense BakkerMay 6, 2025

        No opinion here, but I think you misunderstood what declarative vs imperative programming means, judging by this comment:

        companies treat React as imperative

        Imperative programming means you write the specific instructions and hope that the code produces the expected outcome.

        Declarative programming means you declare the desired result and the code interpreter takes the required steps to achieve that result.

        This guy explains it really well:
        stackoverflow.com/questions/178466...

        Most frameworks including web components are considered mostly declarative. That is, they allow you to stick very close to the language/words that make sense for your business logic, which is one of the advantages of declarative vs imperative.

        • Martin Ledoux
          Martin LedouxMay 6, 2025

          I think he just meant "imperative" by itself - not "imperative programming".

          imperative:
          adjective: of vital importance; crucial.
          noun: an essential or urgent thing.

          • Besworks
            BesworksMay 6, 2025

            That's exactly what I meant. Companies treat React as an essential tool with no alternatives.

            But to address the programming styles. A properly designed web component is coded imperatively and used declaratively. The core functionality is abstracted away. You can modify the behavior or even replace the component entirely without altering the implementation.

    • Danny Engelman
      Danny EngelmanMay 6, 2025

      Ryan creates Solid, Rich creates Svelte

      All Cool-Framework-Authors dislike what the WHATWG (Apple, Google, Microsoft, Mozilla) comes up with.

      • Besworks
        BesworksMay 6, 2025

        And they are absolutely free to do so. That's the best part of the web! It just bothers me when a third-party's idea of what's best takes precedence over the consensus of those who built and maintain the platform.

        Solid, Svelte and all the other cool frameworks each have their following. If a dev or team chooses to use one of them you can be pretty sure they at least did some research and made a decision based on perceived value. But when there's mass adoption of a framework like React simply because it's the biggest name on the list, that creates a snowball effect that hurts everybody.

    • AndrewTrefethen
      AndrewTrefethenMay 6, 2025

      It is not general consensus that declarative is better than imperative. At best, you have a vocal subset that FEEL that declarative is better than imperative. That nuanced distinction is why there are always escape hatches in any of the "declarative" frameworks. At some point you have to stop describing the work and actually DO the work. That's either in YOUR code, or it's in the framework code, and often times it's strewn throughout both.

      React started by Declaring the UI given your state. Today it's more common to Declare your data management given your actions (UI being a derivative of both with cross cutting concerns)

      Frameworks implement some functionality meant to set up a particular mental model, ease some tasks, and produce things of value. They do this at the cost of overhead, abstraction, and impedance mismatch when you need to do something that doesn't neatly fit into the provided abstractions.

      React in particular has a history of slowing teams down compared to using native JS and HTML. I die a little inside every time I see a basic crud application loading a large js-bundle just to have to reimplement the browser's navigation on order to avoid a page load. The performance ends up measurably worse and business logic leaks into the frontend. I've made a reputation for coming into projects that are wildly off track in terms of time and budget, and getting them back on schedule by ditching react and having the team reimplement the UI from scratch in a basic server-side rendered library. I've done it several times and every time it has resulted in significant time savings and simpler implementations. KISS applies to the WHOLE stack

  • Gabe
    GabeMay 6, 2025

    I have been using web components since 2018 and since 2022 currently working on a high profile project at work using web components. I was told by other developers I should use react. Turns out using web components was the best decision I made. Someone tried to poach my project by building it in react but nobody can match the speed, loading time and the low file size of the whole project. There is no updating npm dependencies, updating frameworks and migrations etc. We have established design patterns and have not needed to do anything different. We use all kinds of web components libraries and we can mix them no problem. It's so easy to work with, super easy to debug. It stinks because there aren't many or any companies using it, but there also isn't a lot of proper documentation to solve and offer corporate solutions. The downside is the learning curve for web components, you really need to understand JavaScript. Hiring becomes hard because there are just a bunch of react developers and not JavaScript developers. As this trend continues we have no choice but to know react to get jobs with the majority. At least I can say from experience of having done both, web components was amazing and a missed opportunity for blazing fast development.

    • Sushruth Shastry
      Sushruth ShastryMay 6, 2025

      Dude I wanna learn more on how you do it. I'm a react user but web components impress me so much. How do I convert?

      • Besworks
        BesworksMay 6, 2025

        Stay tuned for more articles on this subject including tutorials. I intend to write about everything from the basics of how to get started, to advanced techniques that I have both learned and invented, to building fully functional web applications entirely from web components.

    • Besworks
      BesworksMay 6, 2025

      Thank you for sharing your experience! This is the kind of thing I want to draw attention to.

      Hiring becomes hard because there are just a bunch of react developers and not JavaScript developers.

      This is a crucial point. Many framework-centric developers simply do not fully understand the underlying platform. My goal here is to share deep understanding of these misunderstood tools.

      • hesxenon
        hesxenonMay 6, 2025

        y'know what I wanna know? How to write profiles to hire devs that know web components (and I don't mean "has written a lit hello world app"). Like, with react I can write "5y exp. with react, react hooks, etc". What do I write for CEs? "5y HTML exp"? Then I'll get someone who still recreates the <details> element and such...

        As much as I hate it, I think the web platform needs some sort of bullshit bingo :/

        • Besworks
          BesworksMay 6, 2025

          I think there are two key phrases that would be ideal to use:

          • Strict W3C Standards Compliance
          • Shadow DOM and Associated APIs

          This will likely scare away the average framework-centric dev. You could quiz the rest to be sure. And I don't mean a written or multiple choice test. Just a simple live conversation about the standards. If they don't have even a rough idea off the top of their head then they definitely don't have the deep experience you are looking for.

          Or you could just reach out to me and we can discuss your project. I am available for work right now if you need help.

  • gunslingor
    gunslingorMay 6, 2025

    Not sure about this homie... you might, for example, add an example. Here is a data table component with back and frontend pagination/filter/sorting/search built in web components vs. React. Then you could prove your thesis rather than just stating opinion. One should remain objective when analyzing architectures. I built all this stuff 100 times before react existed, and 100 times after, I still use react ATM but open to be convinced that another is better.

    • Rense Bakker
      Rense BakkerMay 6, 2025

      It's not better, it's something completely different. Web components are isolated units that are not designed to be managed by some app wide state manager like in React, although you can certainly do that and there are frameworks out there who make it easier, like atomicojs for example. Web components are all about isolation and reusability. Consider them as independently published building blocks, that you can use inside a bigger application where you'd use them the same way you're using div or input right now.

      • Besworks
        BesworksMay 6, 2025

        Exactly. Or just build your own component library. The point is that they can be used just like native HTML Elements. They blend seamlessly into the fabric of the web.

      • gunslingor
        gunslingorMay 6, 2025

        That is basically the point of React, reactive components. Same with angular really. I do agree though, generally if you 'need' a framework to program than your language sucks... and JS and HTML has sucked. Problem with react, its strict on component composition and most devs get it entirely wrong so they fall back on global states and useMemo, which becomes unmaintainable fast. But if you focus on component composition and 'lifting state' to the lowest needed level, it basically guarantees optimized renders if you do it correct. TS helps to achieve it in react. Angular is more open and less strict, easier to achieve but harder to enforce. Web components does sound like a potential replacement, like silverlight vs. HTML5 canvas, which would be ideal... but if it can't replace a framework we all find critical, I don't know if I'll use it or for what.

        • Besworks
          BesworksMay 6, 2025

          The only optimized rendering is that which is done by the browser itself through compositing. Every DOM update is expensive. React components are notorious for causing unnecessary re-renders of the entire component for a small change in state. Add to that the Virtual DOM and now you have added significant performance overhead.

          By contrast, an efficiently designed custom element would update only the single part of itself that needs to be changed. If positional changes are handled via transforms only then there are no modifications made to the DOM at all and you enter the realm of true rendering optimization.

          • gunslingor
            gunslingorMay 7, 2025

            Not sure what you guys are building, maybe video games, but I've never had any issues with render speed in react unless the architecture is horrendous. A component will only rerender in react when it's props change, or it's parent changes. What often happens is devs fail to use proper component composition (I.e. children prop) so that the component hierarchy actually matches the intended rendering tree. Some devs rely entirely on global state, they've already lost usually when they do that. Often apps aren't built asynchronous properly, that also hurts in react. Generally only the user object and constants should be global in my react apps, I.e. when the user changes, that's the only time everything should rerender generally. When you do that, no reason you can't make a react component with zero props, so it only rerenders itself... the challenge for the architect is finding which layer in which to use each strategy. But when done right, man react just purrs.

            • Besworks
              BesworksMay 7, 2025

              Yes games, that is one good example where rendering performance is crucial. But really, any animation heavy UI elements. Here is one example that animates an SVG image, and another which manipulates a clip-path, or if you would like to see a more complete example, here's a full app demo built completely from web components.

              • gunslingor
                gunslingorMay 7, 2025

                But anything like that I would traditionally use the canvas and math, which has zero to do with react which could onky be a wrapper at most. I can't see the code for your demo site, or I'm missing it, but I'm getting the impression your doing that without the canvas. Css animation I think is cheap in react, but yeah I could see js based animations in a component, constantly resetting state, would be costly. I've used three.js I'm angular and react before no issues I recall, but its all canvas. Basically was a parts drill down gui, ordering, maintenance procures, etc. Funny though I tell you, I have seen some pretty basic react apps that should be fast, hose to hell, more often than not. Angular and most other frameworks are harder to screw up. And react and libs have responded in ways that discourage proper react. In the end, you need components... can call it a producer, provider, factory whatever... the rest is really just the vendors implementation preferences.

                • Besworks
                  BesworksMay 7, 2025

                  I can't see the code for your demo site

                  view-source:https://bes.works/bits/ or Ctrl+u

                  I'm getting the impression your doing that without the canvas

                  That's right, there is no canvas involved. Here's a much more advanced example. This app was built entirely from custom elements and involves a significant amount of complex state handling and rendering optimizations in tandem.

                  • Greg, The JavaScript Whisperer
                    Greg, The JavaScript WhispererMay 7, 2025

                    erm apologie @gunslingor but React isn't reactive... at least out the box.

                    You would need to use something like MobX

                    • Rense Bakker
                      Rense BakkerMay 9, 2025

                      Really? A state manager that follows mutability pattern suddenly changes something about the reactivity of React? I think what you mean to say is React follows a different rendering strategy with the vdom, instead of the signals based fine-grained dom updates that something like SolidJS uses. The effect is the same though, you only update the dom nodes that actually changed. React just has an extra step to calculate what changed.

                      Btw mutability (mobx/valtio) is an anti-pattern in functional programming.

                      • Greg, The JavaScript Whisperer
                        Greg, The JavaScript WhispererMay 9, 2025

                        Yeah interesting views... maybe explain them to the React team?
                        Image description
                        legacy.reactjs.org/docs/design-pri...

                        and they only exposes a mutable interface to the developer...

                        yikes.

                        • Besworks
                          BesworksMay 9, 2025

                          Reactive Programming is just an esoteric term that attempts to redefine something that doesn't need to be redefined. JS is event-driven by nature and always has been. When using React you actually reduce reactivity by inverting this model. Not only this but you break the promise of asynchronicity and have to jump through hoops to get it back. Why even bother?

                          Every DOM Node and many other objects derive from EventTarget which means that they can receive and emit events. You can also easily create your own objects that extend EventTarget, and with EventSource or Web Sockets you can even listen for server generated events. All the reactivity you should ever need is baked right into the language.

                          • Rense Bakker
                            Rense BakkerMay 10, 2025

                            I don't need to explain anything to the React team, however you could benefit greatly from understanding what mutability is, so in the future you might understand that it doesn't change anything about the rendering strategy of React.

                            • Greg, The JavaScript Whisperer
                              Greg, The JavaScript WhispererMay 10, 2025

                              Ah ok I went and learnt mutability is it something like this?
                              immerjs.github.io/immer/

                              the rendering strategy or react? it only has one strategy ever internally.

                              • Besworks
                                BesworksMay 10, 2025

                                mutability is an anti-pattern in functional programming

                                Good thing JS isn't a rigid functional language. It's a dynamic, multi-paradigm language, just like the web itself. Mutability is a core feature not something to shy away from. It's essential to creating a rich, interactive user experience.

                                If you need immutability you absolutely can accomplish that in various ways. The most obvious being the const keyword but also through use of private properties or getters without setters or Object.freeze.

                                it doesn't change anything about the rendering strategy of React

                                Having the power to dynamically change almost anything comes with the responsibility to understand how the browser handles reflow and repaint. React's Virtual DOM is their way of batching updates. The standard way to accomplish this is by using a DocumentFragment.

    • Besworks
      BesworksMay 6, 2025

      Don't worry, I will be writing more articles on this subject. However, in this one I linked to a page with dozens of examples of components that I have built. Feel free to view the source of any one of them to see how a well designed custom element should be structured.

      • gunslingor
        gunslingorMay 7, 2025

        Took a look. Need that intro and code 🙃. I would love it if these frameworks vanished overnight for native language features... I really kinda miss the days before even git was a thing, lol, I'm old.

  • Nevo David
    Nevo DavidMay 6, 2025

    yeah i kinda feel this. i got tired of redoing the same stuff every few years too. sticking to the basics just feels better for me

    • Besworks
      BesworksMay 6, 2025

      Yes! I have been using web components in production since 2017. Many of those projects still hold up today. And as the platform stabilized, the need for polyfills faded away. Because I had planned for the future, simply removing the supporting libraries was usually all that was necessary to modernize these projects, aside from the occasional update to improve them based on new features or better techniques that I learned over the years.

  • Ben Sinclair
    Ben SinclairMay 6, 2025

    I'm not a react expert, but I've used it. I don't think it's worth new coders learning, because there are much better solutions to the problems it solves now, and a lot of it appears to be baggage solving problems that no longer exist.

    • Besworks
      BesworksMay 6, 2025

      I agree. The problems React once solved are no longer problems. At this stage it just adds complexity that is not necessary.

    • Ramon Polidura
      Ramon PoliduraMay 7, 2025

      I think you're wrong, why wouldn't every new developer learn it? is the most used framework and can open many more doors than any other one. Not using it is not easier, in my opinion.

      • Besworks
        BesworksMay 7, 2025

        New web developers should be learning JavaScript fundamentals not filling their head with ideas that do not align with the web standards. One should choose a library or framework based on experience and need. Otherwise it's like trying to build a pyramid upside down, eventually the weight of language will topple their fragile framework-based understanding. Better to start with a strong foundation.

        • Ramon Polidura
          Ramon PoliduraMay 7, 2025

          I agree, and then, learn React because it will open a lot of doors for them.

          • Besworks
            BesworksMay 7, 2025

            real fake doors

            Are there really opportunities for inexperienced devs in the React ecosystem? Why would a company hire a brand new dev who just learned React when the market is already saturated with those who have been using it for years? Better to learn something new and fresh and be poised to take advantage of the inevitable shift in the landscape.

            • Ramon Polidura
              Ramon PoliduraMay 7, 2025

              inevitable shift? React has been the go to library for a long time and since the beginning people have been saying that it won't last long. People WILL hire a junior dev that knows React over one that doesn't, React teams will hire junior devs and someone that already knows react will have a door open, what are you talking about?

              • Besworks
                BesworksMay 7, 2025

                React's popularity has been in steady decline for several years.

                react popularity over time

                It still holds a significant market share but... people also still use jQuery in 2025.

                So will React ever disappear completely? No.

                Is it worth learning today? That's debatable.

                Is it the only option? Absolutely not!

                • Ben Sinclair
                  Ben SinclairMay 8, 2025

                  To be fair, that crop is a little misleading. The full graph shows it better, but even so it's a terrible graphic in terms of conveying information to the user!

                  The thing it ends up showing is that React has an overall more positive opinion from actual users than any other framework it's competing with. The site you link to also states in the accompanying blurb that this is the common pattern for frameworks, so it's not really behaving any differently to others, it was just more popular to start with.

                  That being said, I'll work on legacy React projects but I will not start any new ones by choice.

                  • Besworks
                    BesworksMay 8, 2025

                    Yes, a common pattern that was exactly the point. All the graph shows is that a lot of people have used React and that its popularity took a nosedive right around when web components started stabilizing. The other links further illustrate this pattern as predictable.

                    React did to web dev the exact same thing that Facebook itself did to the web. It attracted the average person. But just because a few billion jump on a bandwagon doesn't mean they have any idea where that wagon has been or where it is going.

                    The majority of Facebook users don't know anything about the nature of the web as a whole, and an alarming number of React users don't know anything about the platform it's built on. They simply accept their narrow spoon-fed viewpoint as axiomatic.

                    Zuck recently admitted that Facebook no longer really serves its original purpose. Many of its original users abandoned it long ago. React seems to be heading in the same direction. For anyone who has been watching the trends since the beginning, this is entirely expected.

                    • Ramon Polidura
                      Ramon PoliduraMay 8, 2025

                      you're living in the clouds mate, ANY developer should know React, and any dev should learn it first.

                      • Besworks
                        BesworksMay 8, 2025

                        you're living in the clouds mate

                        And I have an excellent aerial view of the landscape from up here. The fact of the matter is that many React users don't want to use it, they do so because they have to.

                        react usage 2024

                        I don't expect to sway any of that segment who do want to use it. Just as I don't expect die-hard Windows fans to jump ship for Linux. If you're happy with React, then by all means continue using it. But don't try and pretend that it is the best simply because it has the highest body count.

                        any dev should learn it first

                        Telling beginners to learn React first is like pointing them at a forklift when they don’t even know how to drive a car. Sure there’s some overlap, but it’s heavy, specialized, and won’t teach them the everyday skills they need to maneuver in traffic.

                        • Ramon Polidura
                          Ramon PoliduraMay 8, 2025

                          React is required in 80% of the positions I'm applying to when I look for a job, period.

                          • Besworks
                            BesworksMay 8, 2025

                            I know. And I'm sick of it. Especially when some hiring manager with no clue about how the web actually works tries to imply that I am somehow less knowledgeable about web development for not wanting to use React.

                            The thing is though, the vast majority of jobs that insist on using it are not ones that I would even want to get involved with anyway. But the real problem is that companies just assume that the most popular option always equates to the best option. So it ends up being a requirement even for jobs where it completely over-complicates the scope.

                            And because of this mentality, experts on web standards are being squeezed out of our own industry in favor of juniors straight out of code bootcamps. Where will that leave the web in 10 years? And what will all these React only devs do when the bubble pops? 🤷

                            The only way I can see to fix this is to keep building a better web, one component and changed mind at a time. We as developers need to stand up for the standards and show companies how they can enable us to build better apps faster and easier without all the extra baggage.

                            However, we can't do it with rhetoric, we need real results. I'm doing my part, but I'm only one guy and I'm sure that I'm not the only one struggling in this economy. If I had the backing I could train an army of standards-first developers. I have the skills, knowledge and voice to do so. But instead, as a standards-only freelancer, I'm stuck competing with my peers over scraps. So, if anyone would like to collaborate on changing the world, please let me know.

      • anxpara
        anxparaMay 20, 2025

        fuck React

  • keyr Syntax
    keyr SyntaxMay 6, 2025

    If React gets the job done, what else do we want? Rather than jumping from React to another tool, it is better to focus on building and shipping more products with the tool we are already familiar.

    • Rense Bakker
      Rense BakkerMay 6, 2025

      If we started using this kind of reasoning in 4000 bc, we'd still be using sticks and stones to solve every problem...

      Right now, React solves many problems, but the past few years a lot has changed in webdev, as a result, React has also changed. There will be a point where it can no longer keep up with other more modern tools to fix problems and eventually it will become obsolete.

      • Danny Engelman
        Danny EngelmanMay 6, 2025

        I had to learn them 4000BC sticks and stones in Uni (class '87 - Hogeschool Utrecht)

        If history teaches us anything; its that React will be around for a long time.

        PS. I am only doing 100% native Web Components development (without dependencies)
        I just like software that just runs for the remainder of my life

        • Besworks
          BesworksMay 6, 2025

          Oh for sure, it will be around, but most jobs related to it will eventually become maintenance only. Would you want to start a new project today using say Cold Fusion? I doubt it, but I guarantee that there are some highly paid CF devs still out there holding up the backbone of their company.

          PS. I am only doing 100% native Web Components development (without dependencies)

          That's awesome! Such a rare thing to hear, but I really hope to change that. Thank you for participating in this discussion.

      • Besworks
        BesworksMay 6, 2025

        🎯

    • Martin Ledoux
      Martin LedouxMay 6, 2025

      I know people who had that mentality about jQuery, who when realizing it was actually obsolete, moved on from software development to project management. I'm not saying anyone should stop using React today (I make heavy use of Angular, so this conversation is making me nervous and realizing I have yet another thing to learn), but just as has already happened earlier in my career, I realize that the tools I use today may need to be replaced - and that's either with other tools or actually something more foundational like web components.

    • Besworks
      BesworksMay 6, 2025

      It's not about jumping to another tool. It's about stepping down from the illusion of safety on the island of React into the raging river of the platform itself. The river keeps flowing whether you want it to or not. Pretty soon you won't even be able to see the ones riding the current from your position. Do you really want to be left behind?

  • Naresh Teli
    Naresh TeliMay 6, 2025

    To be frank, if React or Angular feels like too much, you probably didn't need them in the first place. Without such frameworks, you're likely to get stuck in boilerplate, reinvent existing solutions, struggle with knowledge transfer, and face higher maintenance costs

    Web component shadow the html part not the js one where most of logic, routing and rendering part exist. Angular already using the advantage of web component to isolate the css at component level

    • Besworks
      BesworksMay 6, 2025

      To be frank, I never needed them at all. Ever. Not once in my career have I ever felt that any library or framework was essential to completing the job.

      The entire point of web components is to reduce boilerplate. You solve a problem once and it is solved forever. You can then use that solution in any project. If you discover an issue or want to improve the component you do so once and, if you are loading your component library from CDN, all instances will be instantly updated.

  • Andrew Bone
    Andrew BoneMay 6, 2025

    React and web components answer slightly different questions. There certainly has been some blurring of lines over the years.

    I'd agree that there is merit in creating reusable gui elements as web components to allow them to work everywhere but I struggle to see any real benefit beyond that.

    • You still need JS to load the components
    • Encapsulation of app logic is a nono, leading to more complex pages (and more prop drilling).
    • With the shadow dom you can't, easily, style from outside leading to multiple variants of the same component.

    I really liked web components when they were new and even built a few polymer apps but I just found myself using them less and less and they weren't that useful in practice.

    • Martin Ledoux
      Martin LedouxMay 6, 2025

      As for your bullet about prop drilling, I was thinking that you could still make web components that use some sort of state management - just not a State Management library tied to a specific framework like Angular's NgRx. However, at that point you have undermined the portability promise. I suppose you could make plenty of reusable components not tied to such a library (like your own input component or color picker, etc), but if you're using web components to make pages, those would have to be tied to app logic and would not be reusable across other apps and even frameworks. Basically the primitive components would be reusable, but the app specific ones would not.

      Point being, you could probably avoid using a framework and use popular patterns found in various frameworks such as dependency, injection, State Management, services, etc - but you would have to be careful to separate your portable web components from the project-specific ones.

      • Besworks
        BesworksMay 6, 2025

        Exactly, state management is a job for the app itself not the components it's built from. You don't expect a form field to manage it's own state beyond the specific features that it provides. You wrap extra logic around it to suit your specific use case then you wrap an app around that. Simple separation of concerns.

        • Andrew Bone
          Andrew BoneMay 6, 2025

          React is a state management library that happens to be able to supply dom elements (with react dom) I think you're more fight against bad react usage rather than react as a whole.

          • Besworks
            BesworksMay 6, 2025

            Actually, I would argue against any bad usage of web technologies regardless of the library or framework involved. The core Web APIs provide a finely-tuned, meticulously-documented, consensus-based framework without the need for any additional libraries.

            Browsers are perfectly capable of maintaining state through Session Storage, Local Storage, IndexedDB, cookies, bfcache, and service workers (anything I missed?) each with their own specific use cases. And because of the open nature of the web you can NEVER trust the client anyway, so the one and only true state should be that held by the server itself. With Web Sockets this can be synced in real time to the client. I don't see why a third-party state management solution would ever be necessary.

      • Andrew Bone
        Andrew BoneMay 6, 2025

        100% you can use what ever you want to handle state but it raises the question what wins do the effort of using web components (as opposed to just straight up HTML) get you.

        • Besworks
          BesworksMay 6, 2025

          Custom Elements === HTML Elements

          That is the true benefit. They are not opposed to straight up HTML they are a direct extension of it.

    • Danny Engelman
      Danny EngelmanMay 6, 2025

      👎 You still need JS to load the components

      🎯 DSD - Declaractive shadowDOM creates Components without JS

      👎Encapsulation of app logic is a nono, leading to more complex pages (and more prop drilling).

      🎯 Its just POJ (plain old javascript) add any state management library you need

      👎With the shadow dom you can't, easily, style from outside leading to multiple variants of the same component.

      🎯 RTFM:

      1. CSS properties
      2. constructed stylesheets
      3. ::part and exportparts
      • Andrew Bone
        Andrew BoneMay 6, 2025

        Thanks for your response but none of these really answer my concerns.

        Declaractive shadowDOM is no better than just using HTML, you can't have any interactivity, why add the complexity?

        The just use JS argument is a little odd, as you can just use React, Preact, Angular or whatever you like, why add the complexity?

        Your response to the styling from outside is complex is here are the complex methods you can use to style it from outside.

        Whilst I don't have an issue with web components they rarely seem worth the effort (even if they effort really isn't that great).

        • Besworks
          BesworksMay 6, 2025

          why add the complexity?

          Encapsulation.

          Shadow DOM is not at all required but solves a litany of issues that have plagued the web for years. Personally I think div soup is disgusting and CSS frameworks like bootstrap and it's derivatives were a step backwards.

          External styling does not need to be complicated. When designed properly, a Custom Element is just as easy to style as any native element. With CSS you can target the custom element and it's slotted descendants just like any built in element.

          your-custom-element.your-class { ... }
          your-custom-element > button { ... }
          
          Enter fullscreen mode Exit fullscreen mode

          And within your Shadow DOM you can modify internal styles based on the state of the :host.

          :host(.your-class) { ... }
          :host(.your-class) header { ... }
          :host(:not([disabled])) ::slotted(button) { ... }
          
          Enter fullscreen mode Exit fullscreen mode

          It's simple, elegant and effective.

    • Besworks
      BesworksMay 6, 2025

      You still need JS to load the components

      Actually, that is not entirely true. You can create custom elements through markup and css alone. They will not have any complex logic but JS is not technically required.

      Encapsulation of app logic is a nono

      Then don't encapsulate your app logic. The point of components is to abstract and encapsulate the parts of your app that should be kept separate. You are building your app on top of the components—using them. Each component should only be responsible for it's specific behavior.

      leading to more complex pages

      A properly designed app built from web components is actually less complex. The extra complexity generally associated with web components is almost always a byproduct of using them wrong.

      With the shadow dom you can't, easily, style from outside

      But this is exactly the point of Shadow DOM. To encapsulate your styles away from the host page so that they don't get clobbered by page's CSS or that of another library or component. A properly designed custom element has only bare-bones structure and styling similar to that of a native element that can overridden by standard CSS.

      • Andrew Bone
        Andrew BoneMay 6, 2025

        Actually, that is not entirely true. You can create custom elements through markup and css alone. They will not have any complex logic but JS is not technically required.

        You are technically correct meme

        I jest I truly didn't know how far creating components without JS had come but I still don't think it's good enough, I'd much rather just have raw HTML/CSS.

        Then don't encapsulate your app logic. The point of components is to abstract and encapsulate the parts of your app that should be kept separate. You are building your app on top of the components—using them. Each component should only be responsible for it's specific behavior.

        You could imagine having a component that loads in some data, having a loading state until the data is loaded, show the data and then allows you to modify the data again with a loading state as it saves.

        This component doesn't need separating as it's all one concern, the form data (or whatever), but to make this work with web components I'd have to jump through some hoops, again not the end of the world but it feels like an extra layer of complexity.

        A properly designed app built from web components is actually less complex. The extra complexity generally associated with web components is almost always a byproduct of using them wrong.

        OK, that feels like the answer of someone that doesn't have to work in teams of varying skill very often but perhaps it really is that simple 😊

        But this is exactly the point of Shadow DOM. To encapsulate your styles away from the host page so that they don't get clobbered by the host page CSS or that of another library or component. A properly designed custom element has only bare-bones structure and styling similar to that of native element that can overridden by standard CSS.

        A properly designed app built with CSS in mind doesn't need styles encap.... 😀

        I personally use CSS modules to prevent clashes but I know that means a build step which you might want to avoid


        I should probably say I'm not again web components and think everything has its place and every dev has their preferred way of working. For me the simplicity of react handling state and handling render based on that state allows me to work quicker without having to worry about all that. Sure there are foot gun and misuses of the platform but I'm sure that's true with all app building methodology.

        • Besworks
          BesworksMay 6, 2025

          Using Custom Elements in your project actually helps in a team of varying skill. Because someone with the knowledge to solve a particular problem can do so and share that with the team in the form of an easy to use component. The user of the component only needs to know basic HTML and CSS.

          Encapsulation is important because not all apps are built in a homogeneous ecosystem. Polluting the global scope has long since been considered a bad practice in the JS world. Shadow DOM further enforces this and extends the ability to CSS to ensure that third-party libraries or even the work of your own team don't clash. Sure this can be mitigated with careful CSS scoping but you can never be guaranteed that your nicely designed widget won't break some day because of careless changes outside of your control. Why risk it when this problem can be completely avoided?

  • Rense Bakker
    Rense BakkerMay 6, 2025

    I would like to see web components being used more for design systems, but I understand why most companies don't. They have a bunch of "x framework devs" employed, so it's just easier to do everything in "x framework".

    Hopefully it'll get better now that React has support for web components 🥳

    • Martin Ledoux
      Martin LedouxMay 6, 2025

      This is a really great point. Often I've seen people do hiring without even talking to the team about needed skills. "We're hiring a front-end developer". Nothing more specific, and entirely vague. Sure, if the project uses a specific framework, anyone can learn it, but there's a lot of ramp up time there, let alone learning the application logic itself. Sometimes someone with skill in only a different framework has been brought on board, and it was a nightmare as they tried to import all sorts of patterns and practices that didn't even make sense in the current framework. But frameworks aside, I like your idea about hiring people just to make custom web components - in the past I've even taken it a step further. I'm far better at programming than I am with design, and I'd be totally on board with a CSS wizard being hired, even if the person doesn't have strong programming skills.
      But it seems that there's a disconnect between what skills a team needs, and project managers' desire to throw more developers at a project, regardless of skill set.

    • Besworks
      BesworksMay 6, 2025

      This is something that always bothered me. Non-technical policy makers controlling the technical landscape through anti-progressive decisions whether intentionally or not. One cannot measure a product's true worth by market share alone.

  • Steve Perry
    Steve PerryMay 6, 2025

    As a developer that spends probably 75% of my time in react, I've found web components to be a breathe of fresh air. I've settled on a very simple in-house global state solution coupled with lit to be extremely powerful. That said, I've struggled with how to implement css libraries across components. Bundle sizes are a fraction of the size of react builds.

    • Besworks
      BesworksMay 6, 2025

      Sharing CSS across components is an advanced topic that I plan to cover in a future article. The simplest way is to just use a <link rel="stylesheet"> inside your ShadowDOM. But there are other techniques I will share that can be used to mitigate the need for this.

  • Scott
    ScottMay 6, 2025

    I generally agree with this sentiment. If you're developing for the web, it makes sense to explore (and use) native browser technologies compared to web development frameworks. However, one area where React still makes sense is if you are developing a web app as well as a mobile app. In this case, you can use the React Native framework to develop the mobile application. While there are some differences, React/React Native share much in common that make it easy to develop for the web and mobile simultaneously.

    • Besworks
      BesworksMay 6, 2025

      The web platform is universal. It can run on basically any device with no compilation or abstractions (other than an available browser). It is far easier to embed a webview into a basic mobile app template. And the core Web APIs have gotten much more advanced lately. You can access hardware devices and do many of the things that native apps can do directly. And for features that are not available there is always WASM compiled native code as an option.

      • Scott
        ScottMay 7, 2025

        True, I haven't played around much with Webviews or WASM yet, but what I like about React/React Native is that I can program in one language using one framework (more or less) and build for both web and mobile simultaneously. To each their own. :)

  • José Pablo Ramírez Vargas
    José Pablo Ramírez VargasMay 6, 2025

    I don't understand why people are misinterpreting what I stated in my other comment thread, especially when you have a direct comparison to the term "declarative programming".

    I clearly meant "declarative programming" vs "imperative programming". If for any crazy reason this is not clear, you can see that I enumerated all-declarative libraries and frameworks. How many more clues are needed?

    Why this other thread?

    Well, Rense Bakker has me blocked for some reason, and I have never blocked him back, mostly because I can handle comments of all sorts. In short, I don't care.

    However, this disallowed me to respond to my own thread. So, buddy (Rense), I'll block you now so I don't have to experience the inability to reply on my own threads. Nothing personal.

  • maneamarius
    maneamariusMay 6, 2025

    Less is more. It's always been true, and will always be. Don't over-engineer.. like most people tend to.

  • Kris
    KrisMay 6, 2025

    Almost every React app could easily be replaced with AlpineJS or any micro state manager. Most people just don't know JavaScript, they simply learned React. No different than a "PHP Developer" who only knows Laravel or WordPress functions, but not how PHP actually establishes a DB connection. React is simply an "easy" to use framework that most frontend "developers" learned because they Googled "Best JS framework" and picked from Vue, React, or some Hipster 3rd option

  • Deividas Strole
    Deividas StroleMay 6, 2025

    This is a passionate and compelling defense of Web Components — and I completely agree that it's high time developers give browser-native tools the respect they deserve. The platform has come a long way, and it's refreshing to see someone championing standards over abstractions. React undoubtedly helped shape the modern front-end landscape, but in 2025, it's worth asking whether many teams are using it out of habit rather than necessity. Web Components offer flexibility, interoperability, and longevity — all without the vendor lock-in. Thanks for voicing what many of us have been thinking!

  • Samuel
    SamuelMay 6, 2025

    And I'm here now to tell you that you never NEEDED any of them and this has never been more true than it is today.

    I got into a week long fight with a guy on another team over this. He really wanted me to adopt angular but it was not even 1.0 yet. (Imho it didn't even get usable until 3, and even then just barely.) I told him

    a. my team knew what they were doing,
    b. We could do anything angular could do with just standard web tech (and proved it often).
    c. It was adding a layer of complexity that was just too confusing for my team.

    I trialed it on a simple project and it failed miserably. It took us less time to rip it out and do it "manually" than it did to get angular up with basic functionality. Even when it was working, we had to shim a bunch of stuff to fix the bugs in angular.

    I've always been a proponent of KISS and I enjoy using the raw web to get shit done. (I do use vue and svelte from time to time because they are setup like web components. Also cuz of my job.)

  • Eric Bishard
    Eric BishardMay 6, 2025

    Yes, you can use Web Components in Vue, Svelte, Angular & even React — but the ease and quality of integration will variety. They do offer a form of interoperability that framework components typically don’t.

    I think the statement “Everything we need to build robust, modern apps without heavy abstractions” is a bit misleading.

    While Web Components are powerful, they don’t provide built-in state management and don’t provide declarative routing, data fetching, or rendering optimizations out of the box. And I’m not saying these things are necessary in every app. But to match it, you’d need to build/integrate a lot of additional tooling to match what React provides via its ecosystem.

    Now what I truly believe. It’s sometimes rough for a junior or someone new to development to step outside of react and build the small things easily. There is a lot that they don’t know even around the basics that react or Next JS, just do.

    But… with the technology we have in AI, fit your smaller projects, devs should really be trying to build light and fast. With web components add creating components there can reuse pretty much anywhere.

    I would also tell them: Most real-world apps do use build steps (e.g. TypeScript, bundling, minification). Web Components can feel verbose and less ergonomic without tools like lit-html, Stencil, or libraries that smooth things out. Learn these tools because that information can be useful immediately. Build a nice got repo template that sets all of the basics up for your needs and go to that’ every time you need to start small and light. Keep a repo of web components that you can import.

    I largely are with the idea. But it can be different but we have amazing technology at our finger tips to reduce the cognitive and over work load and help us learn new things fast. So try it out and you will know when you need it because you built it

    • Besworks
      BesworksMay 6, 2025

      Everything we need to build robust, modern apps without heavy abstractions

      You make an excellent point. I have changed to wording of the article to "modern components".

      While Web Components are powerful, they don’t provide built-in state management

      Correct. Browsers have other APIs to handle this. My views on state management are available in another comment below.

      It’s sometimes rough for a junior or someone new to development to step outside of react

      This is not a valid excuse in this age of AI assisted programming. We senior devs learned the hard way. All these juniors need to do is ask a bot for help and their questions will be answered. Mind you, the assistants tend to have outdated information regarding web standards and much has stabilized in the last couple years. I have given this feedback to the Copilot team already. I'm sure this will be addressed in due time. Regardless, they still hold enough information to get started. The core Web Components API has been stable and widely available for years.

      Most real-world apps do use build steps e.g. TypeScript

      I get the benefits of type safety from a shared codebase standpoint but JS benefits more from runtime validation that strict typing at the source. The use of TypeScript is purely a team/project decision and in no way affects the overall structure of a Web Components based approach.

      you’d need to build/integrate a lot of additional tooling

      I'm not saying that we should all throw away our favorite frameworks or build processes. All I'm trying to point out is that we have the ability to create amazing new toolkits around modern standards-based methods instead of sticking to aging third-party vendor alternatives.

      Some of the issues we face today actual come from these supposed front-end frameworks taking up too much responsibility for things that should be handled on the back-end. Like routing as you mentioned yourself. I'll admit that when Single Page Applications first became popular I jumped right in full force but over the years I have since re-learned the lessons of the past and now prefer a hybrid approach.

      Here's an example of a declarative framework that I built using this methodology. It is composed entirely of static html with custom elements served through an extremely simple (3kb) index.php templating engine. With bfcache this feels just as fluid as any SPA with none of the drawbacks. Any back-end could just as easily be subbed in because absolutely nothing in the stack is locked to any specific vendor. An equivalent Express router would be trivial to implement and migrate to. The entire structure is just a flat filesystem of valid HTML and associated assets. With a few minor modifications, the whole site could even be served statically.

      While this may not be the most amazing or versatile web application ever built, it is lean, clean and blazing fast. Also, I have not touched this code in 4 years. The type of components featured there have been possible to build for at least that long, yet we are still having this discussion about what this technology can do today.

  • Chris Walsh
    Chris WalshMay 6, 2025

    I wouldn't say we never needed to use frameworks like jQuery and (if you remember it..) MooTools. They were really useful in a time when WebComponents were in their infancy and different browsers have vastly different implementations. I generally choose with JavaScript Modules and massive JavaScript nowadays and it's a lot of fun.

    • Besworks
      BesworksMay 6, 2025

      I mean, I never needed them. I've been writing JS since 1995 and not once did I ever actively choose to use one of these tools. I was stuck working with them on jobs where they were implemented but not one single personal project or one where I chose the stack ever used them.

  • HexShift
    HexShiftMay 6, 2025

    You're absolutely right that Web Components have come a long way and deserve more attention than they get. That said, I think some developers still lean on React not out of habit, but because of the tooling, ecosystem, and community that come with it - especially in larger teams. Would love to see more examples or case studies showing how teams are using Web Components at scale today. Still, this is a good reminder to reconsider our defaults. Also, imagine if browser vendors took the lead on a native Web Components IDE with built-in tooling and integrations - that could speed up adoption even faster. Thanks for posting.

    • Besworks
      BesworksMay 6, 2025

      Would love to see more examples or case studies showing how teams are using Web Components at scale today.

      Here's an interesting example: Reddit. There is no literature on this but their UI is built from Custom Elements and in addition to this, their developer framework Devvit is inspired by React. So that is kind of a unique blend of these approaches.

      I would be interested if you come across any actual case studies or even quiet examples where these tools are already powering the web right under our noses.

      imagine if browser vendors took the lead on a native Web Components IDE

      You just reminded me of Netscape Composer.

      matt damon aging meme

  • Hasani Rogers
    Hasani RogersMay 6, 2025

    The discussion in these comments is inspiring me to write more about web components. I do so at my blog. I'm currently on a project where I had my team write some web components for some pretty slick motion.dev animations. The project is a NextJS app. You truly can use web components anywhere, even with SSR frameworks.

  • Nitesh Rijal
    Nitesh RijalMay 6, 2025

    I'm not sure if comparing React or any other modern framework to Web Components really is apples-to-apples.

    There's a lot more in a framework that just components. I don't use React, never used it because of jsx and mixing of HTML, but other frameworks work the same way and just web components wouldn't give everything a framework gives.

    • Besworks
      BesworksMay 6, 2025

      Many would argue that React is a library and not a framework. Some others would even argue that the Web APIs are a framework in and of themselves. JS can certainly be run in other environments besides the web with no access to these features. Whether it's apples-to-apples or not, React Components and Web Components are still directly comparable enough.

  • Kok Wui Lai
    Kok Wui LaiMay 7, 2025

    it depends on your situations i guess... i will only choose html, js, css when i only need to make is a static page. anything more than 2-3 crud. i will start using react/nextjs. if its mobile confirm go for react native, angular ionic etc

    • Besworks
      BesworksMay 7, 2025

      Static HTML can be used for so much more than just serving simple content that doesn't change. For the majority of my projects I use a component ↭ socket ↭ service model to build realtime apps using statically hosted assets. With this technique it is even possible to serve an app UI entirely from CDN. Add a Service Worker cache in between and now you have an app capable of working fully offline. Completely modular. Zero frameworks involved.

  • Alex Lohr
    Alex LohrMay 7, 2025

    Web components solve a few of react's issues while introducing a lot of their own. However, any of those issues only arise if it matters in the context of your usage.

    If your use case fits web components perfectly, congratulations! But what is great in your case might not work for everyone else (the same is true about frameworks, too).

    React is overused because a lot of developers can use it, so HR can select from a larger pool and hires can more easily be replaced.

    • Besworks
      BesworksMay 9, 2025

      React is overused because a lot of developers can use it, so HR can select from a larger pool and hires can more easily be replaced.

      Indeed, and it's a self-perpetuating problem. Because after years of this behavior breaking out of the React ecosystem becomes a business crippling problem. Companies are heavily invested and locked into the React stack for existing implementations. Obviously I don't expect every existing React based app to be replaced. But any opportunity to get away from it should be seized and new projects started now should adhere to the standards. Doing so will eliminate this issue from future endeavors. It's simply a better business decision in the log run.

      Of course Web Components alone are not a panacea. Switching to them will certainly require architectural changes. But most of those changes lead to simpler, more maintainable systems. There is nothing truly new or exotic about their use. They just extend the old ways to be more flexible. All the problems that will arise from ditching React have well accepted best practices for dealing with them. There is no need to re-invent the wheel. And adhering to standards does not mean avoiding frameworks, there are already players in this space and surely more to come.

      • Alex Lohr
        Alex LohrMay 10, 2025

        There is lit, which fixes a few of TFW issues with WC. Whether the other issues become a show stopper depends on the use case. WC are certainly not a silver bullet.

  • Anita Olsen
    Anita OlsenMay 7, 2025

    I see what you did there 🤭 Love the title.
    React is evil, kill iiit! 🪰🖐️

  • MrDoda
    MrDodaMay 7, 2025

    I have one big issue... As programmers we are all quite lazy. Using react makes a lot of stuff easier, therefore less work. Using web components you would have to introduce a whole structure, build scripts and more. As your project grow the things you need to setup would grow too. Maybe if there was a good framework that already sets all this up. but going from 100 to 0 just because of performance... Let's just say they don't pay me enough. Although I am definitely gonna give it a try on some of my side project !

  • AlbertGao
    AlbertGaoMay 7, 2025

    By locking in React, my components work on mobile too, rendering as native components. And OP simply hasn’t done any work with web components. Otherwise, he would know why it doesn’t work. And this blog really lack of pragmatic points to convey the message of its title.

    • Besworks
      BesworksMay 7, 2025

      OP simply hasn’t done any work with web components

      Except for the numerous examples which I have provided in the comments. And those are only a sampling of components which I have published for demonstration purposes out of many more that I have built since Shadow DOM v1 was first introduced.

      this blog really lack of pragmatic points

      Obviously the article was intentionally sensational to spark discussion. If you are looking for pragmatic points, read through the comments.

  • Rong Sen Ng
    Rong Sen NgMay 7, 2025

    Great one. Have you tried fast.design?

    • Besworks
      BesworksMay 7, 2025

      I have my own component library but this definitely looks like a nice, minimal abstraction layer. Very similar to Lit. Out of all the libraries I have seen, these two are the closest to native. Thanks for sharing! I'm sure someone here will find this useful.

  • Jan Nicklas
    Jan NicklasMay 7, 2025

    yes web components have advantages - but it's not the one size fits all solution you describe

    • web components are not as accessible as standard dom elements
    • web components are not as SEO friendly as standard dom elements
    • web components are slower for the initial rendering
    • web components are not universal - they are browser only
    • web components are worse when splitting js and css code
    • web components don't work well with client side routing
    • web components don't have typed props
    • web components have a smaller eco system

    some but definitely not all of these issues can be fixed with a lot of additional javascript - but if you need javascript for rendering anyway - why wouldn't you just use javascript which renders standard dom elements instead?

    don't pick a framework only because it's build into the browser - pick the framework which is best for your users and developers

    • Besworks
      BesworksMay 7, 2025

      web components are not as accessible as standard dom elements

      That depends on how you build them. I create formAssociated, keyboard accessible, screen-reader friendly components.

      web components are not as SEO friendly as standard dom elements

      This is actually a complete reversal of the truth, assuming you use them properly. I have been promoting semantics since before Google existed. You want to know what is truly not SEO friendly, div soup, which is exactly what you end up with when using most frameworks.

      web components are slower for the initial rendering

      This demo page is blazing fast. Anyone can achieve this level of optimization. The only reason it does not hit a perfect score for speed is because of Google's own analytics code.

      web components are not universal - they are browser only

      Well yes, Web Components are for creating UI elements. It's right in the name of the APIs: Shadow DOM, Custom Elements, HTML Templates... What more do you expect?

      web components are worse when splitting js and css code

      What makes you think that? They are plenty flexible. You can split your markup, js, and css if you wish, or combine into a cohesive unit. You are not forced into any specific structure.

      web components don't work well with client side routing

      Web Components don't care what your routing method is. Hell, you can do pure CSS routing if you really wanted to.

      web components don't have typed props

      Neither do native HTML Elements. If you're worried about type safety, you can write your components in TypeScript. And runtime validation is definitely something you can and should do in production JS.

      web components have a smaller eco system

      Ok, this is a fair point. But something that is easily correctable. All we need is for more devs to start using them!

      • Jan Nicklas
        Jan NicklasMay 12, 2025

        Thanks for your detailed answer and maybe I am wrong and things changed already.
        Could you help me to understand the following questions?

        Is it still the point that web-components make frameworks obsolete?
        Because if web-components also need a framework I don't see the point over using a standard dom framework..

        1. Accessibility:
          a. Can you use aria-labelledby somewhere on the page and target inside the shadow dom?
          b. Given I have my inside my Is it somehow possible to help the screen reader to treat all the radio buttons as part of one group (like "2 of 5 selected") instead announcing each as its own individual group ("1 of 1 selected")?
          c. Does focus delegation work now out of the box as in native DOM without additional code?

        2. SEO:
          a. Does Blink recognise the a tag in your template for Click Me although it is not part of the initial DOM?

        3. Initial rendering:
          a. Do Websites built out of web-components show a broken or empty page until Javascript connects the Custom Elements to their templates?
          b. Can you load only the Web Components which are on the initial view without waterfalls?

        4. Universal
          Don't have a question - you already said it is browser only

        5. Code Splitting
          a. (Same as 3b) Can you automatically split the code per route so that a user only the loads the optimized js and css of the components on the current page without waterfalls?

        6. Client Side Routing
          a. Can you know which web-components will be on a given route before rendering it?
          b. Can you load all web-components js, css and their data for a route in parallel?

        7. Typed props
          a. Would you say typing of webcomponent props is as good as other state of the art frameworks?

        8. Smaller Eco System
          Don't have a question - you already said real world adaptation is still lacking

        Can you please share for what kind of projects you prefer web-components?
        Maybe we are just trying to solve different problems

        • Besworks
          BesworksMay 12, 2025

          Web Components have not made the concept of frameworks obsolete yet, but they have made the way many frameworks work obsolete.

          Custom elements have all the same capabilities that built-in elements have and literally ANYTHING a framework does can be done without one.

          Each of your questions requires more explanation than a single comment could or should cover. Keep following this series and all will be made clear. I have released the next installment with several more already planned.

          • Jan Nicklas
            Jan NicklasMay 12, 2025

            So it's just a new framework like this? 😉
            standards xkcd comic

            I am really looking forward to read your follow up articles

            For now could you please give a short yes/no answer to those questions?

            • Besworks
              BesworksMay 12, 2025

              So it's just a new framework like this?

              Web Components are not a new idea. The standards evolved over time based on consensus from the browser vendors. Frameworks are competing against each other, not the standards. The standards define the features that framework authors can use. New standards will lead to new frameworks.

              Can you use aria-labelledby somewhere on the page and target inside the shadow dom?

              Not exactly, but also you probably should use Light DOM or slotted content instead.

              Does focus delegation work now out of the box as in native DOM without additional code?

              Yes

              Is it somehow possible to help the screen reader to treat all the radio buttons as part of one group

              Yes

              Does Blink recognise the a tag in your template for Click Me although it is not part of the initial DOM?

              Again, use slots or Light DOM where appropriate. Shadow DOM is not required for Custom Elements and does not suit every use-case.

              a. Do Websites built out of web-components show a broken or empty page until Javascript connects the Custom Elements to their templates?
              b. Can you load only the Web Components which are on the initial view without waterfalls?

              They have no more issues than any front-end framework. You must serve critical styles and components as part of the initial payload.

              Universal - Don't have a question - you already said it is browser only

              The JS and CSS parts of a component are browser only. But good Custom Elements can be represented with pure markup. Just go to view-source:https://bes.works. That page content is completely static. It can be viewed raw or with no stylesheet and is still represented in a meaningful way.

              Can you automatically split the code per route so that a user only the loads the optimized js and css of the components on the current page

              Yes

              Can you know which web-components will be on a given route before rendering it?

              Yes

              Can you load all web-components js, css and their data for a route in parallel?

              Yes

              Would you say typing of webcomponent props is as good as other state of the art frameworks?

              Custom Elements are defined by Classes.They can have any type of public or private property that you want. They can also have external attributes.

              Can you please share for what kind of projects you prefer web-components?

              I use them for all web based user interfaces on basically every project since 2017 (with polyfils). My local web dev directory contains 1184 occurrences of customElements.define. Those are not all unique, some are minified versions, or copy-pasted into other project trees, but none of them are third-party code. They include everything from pre-defined page layouts to declarable animations, custom form fields, data managers, video players, chat widgets, etc, etc, etc.

              • Jan Nicklas
                Jan NicklasMay 13, 2025

                Thanks - I guess you are right it goes way to much into detail

                Maybe you can cover the accessibility aspect in a post - I quickly tested the ElementInternals API and it did not work for me:

                codepen.io/jantimon-the-sans/pen/M...

                You can see that VoiceOver says it is 1/1 not 2/3:

                The Voice Over Screen Reader is not able to read the input element of 2/3

                Also I personally don't agree with other answers you gave - if you like to discuss more let me know

                • Besworks
                  BesworksMay 13, 2025

                  Realistically, I would not even use a Custom Element to implement your idea. But if I did, I would simply use a Light DOM approach directly employing the already well defined tools the browser provides: <fieldset>, <label>, and <input type="radio">. When you follow a standards-based implementation workarounds like aria become irrelevant. In fact, the use of aria-* attributes is actually discouraged in any instance where you are able use the proper semantic elements.

                  However, if you really wanted to replace these elements with custom Shadow DOM versions then you would take on the full responsibility of handling all form association and accessibility features through custom scripting. You would need to make extensive use of Element Internals and ARIA Reflection inside your element definitions to emulate the behavior of the standard elements.

                  So, while mapping accessibility features is not simple, it can be achieved. Shoelace is one component library that has made a commitment to accessibility and they are doing a pretty decent job of it. You could try following their example or take a look at how others are handling this, or get creative and roll your own solution.

                  Meeting WCAG guidelines can be tricky even without involving Shadow DOM, and mastering these together will take time and effort. However, the platform is constantly improving and the developer experience will get better.

                  • Besworks
                    BesworksMay 14, 2025

                    Here is a quick example of how a Web Component can be built without a Shadow DOM. These tersely typed <radio-group> elements get completely replaced by well structured, semantic HTML.

                    The final result that gets output to the page looks like this:

                    <fieldset id="rg1">
                        <legend> Pick One </legend>
                        <label><input type="radio" value="yes" name="choice"><span>Yes</span></label>
                        <label><input type="radio" value="no" name="choice"><span>No</span></label>
                        <label><input type="radio" value="maybe" name="choice"><span>Maybe</span></label>
                    </fieldset>
                    
                    Enter fullscreen mode Exit fullscreen mode

                    Just clean, SEO and screen-reader friendly markup that can be fully themed by the page's stylesheet.

                    Of course this is not production ready code by any means, just an example of what can be done. Every JS framework composes down to DOM in the end. I prefer to keep that end result as clean and semantic as possible. To me, the page structure is just as important as the visual representation.

                    • Jan Nicklas
                      Jan NicklasMay 14, 2025

                      Okay that looks better as I expected - but I still believe this would be a lot easier to read if it was written in react.

                      I have an idea (maybe for a post?) - I'll create a small mini react app which uses such a radio group and you show me how you would convert it to a 1:1 web-components equivalent and explain why you believe your solution is better.

                      What do you think?

                      • Besworks
                        BesworksMay 14, 2025

                        Nah, I'm not gonna waste my time writing production ready code to prove a point that you will just ignore anyway. You've made it clear that you believe React is better. Nothing I say will convince you to change your mind.

                        • Jan Nicklas
                          Jan NicklasMay 17, 2025

                          That sounds like a excuse - did you overpromise web-components?

                          About my "believes":
                          I led large projects already before react and tried a lot of different technologies.
                          Even polymer. But everything I saw until today showed always the same result:
                          You can't have the same DX and UX for large projects with web-components

                          Here is a minimal demo - it took me 1h.
                          But you told web-components are superior so I guess you will be faster?

                          Goal is to have the following typed API for other developers:

                          <Carousel>
                              <CarouselSlide>Slide 1</CarouselSlide>
                              <CarouselSlide>Slide 2</CarouselSlide>
                              <CarouselSlide>Slide 3</CarouselSlide>
                              <CarouselSlide>Slide 4</CarouselSlide>
                          </Carousel>
                          
                          Enter fullscreen mode Exit fullscreen mode

                          It should look the same with and without JavaScript

                          demo-peek-carousel.vercel.app/
                          Code: github.com/jantimon/demo-peek-caro...

                          Surprise me - proof me wrong and show me how much better you can develop it with web-components

                          • Besworks
                            BesworksMay 17, 2025

                            First of all. Your example does NOT work without javascript. It "looks" the same sure, but it doesn't work. Go try it yourself with noscript if you don't believe me.

                            Personally, I don't put too much effort into supporting browsers with JS disabled. But well built web components fall back to plain text/css anyway so it's not an issue that I lose any sleep over. However, your example can be accomplished through pure css anyway, no JS at all, if that really matters for your use-case.

                            But the real reason why your example is bad is because you need an entire framework to implement one little feature. Here is a similar component that I built years ago. The source is here. No framework necessary, no compiling, no dependencies it all. And, if you view the markup for that demo page, you will see that the usage is elegant. It's not just a bunch of divs with inline styles applied. It's meaningful, semantic, HTML. Readable even without a browser, let alone JS or CSS.

                            And what happens if you want to use it dynamically? With a web component, you just include the module and add the element anywhere want to use it. Need another one, just append it. Need more items, just add them on the fly. Good luck doing that with your React component without a whole bunch more added complexity.

                            You will never convince me that React is better.

                            • Jan Nicklas
                              Jan NicklasMay 18, 2025

                              You are right - the prev/next button does not work - only the swipe and mouse wheel interactions

                              Most of the time that's good enough for me as I am optimizing for UIs which can be initially rendered without javascript.
                              This helps when javascript which is not under my control takes precious time during the initial rendering (like analytics scripts or bot detection scripts)

                              Also it allows me to keep the same DOM without needing to modify it during startup which can be quite slow - especially on Android budget phones for pages with a lot of features

                              My users don't read the HTML - so I don't understand that point.
                              However what is important for me is Accessibility tree - check it out if you haven't already: Acessibility tree

                              These slides aren't divs - why do you say that?
                              A screen reader even reads out loud on what slide you are and how many there are in total because of the markup:

                              Screen Reader Output

                              The inline styles are only for the sake of the demo - but if those colors where dynamic (e.g. from a database) it might be totally fine to use inline styles.

                              I guess what I like about my version over yours is that it can be developed by different teams.
                              Maybe you work mostly alone but for larger projects it is really helpful to have good APIs - probably that's also why I like typescript.

                              Think about it multiple teams can just write:

                              <Carousel>
                                  <CarouselSlide>Slide 1</CarouselSlide>
                                  <CarouselSlide>Slide 2</CarouselSlide>
                                  <CarouselSlide>Slide 3</CarouselSlide>
                                  <CarouselSlide>Slide 4</CarouselSlide>
                              </Carousel>
                              
                              Enter fullscreen mode Exit fullscreen mode

                              And the team which created the component is still able to change the implementation details and fix bugs.

                              This alone justifies the cost of the framework as long as I can provide real world best of class loading performance (e.g. better LCP than competitors).

                              Do you usually work on large projects with multiple teams or rather on small / solo projects?

                              You will never convince me that React is better.

                              Is that being open-minded as you asked of me?

                              • Besworks
                                BesworksMay 19, 2025

                                These slides aren't divs

                                You're right. The ironic part of your argument is that your React component actually composes down to an unregistered Custom Element.

                                just web components with extra steps

                                To which I say...

                                look what they need to mimic a fraction of our power

  • Jefferson Chidiox
    Jefferson ChidioxMay 7, 2025

    Well I'm used to and comfortable with react. I don't think I have the brainpower to learn another new thing 😑

  • Mostafa
    MostafaMay 7, 2025

    You seems to be an old school developer, with rich experience which is rare nowadays, same here!
    But let's agree that writing codes in declarative way is much better than imperative way.
    The idea is everyday we see a new libraries doing magical things in the front stack, for example form validation, scroll behavior, even library for pagination here I would say 🛑 STOP it's too much abstractions go native even if you will spend some more time writing codes, not every problem need npm install.

    • Besworks
      BesworksMay 9, 2025

      let's agree that writing codes in declarative way is much better

      I agree. As a component creator I aim to design interfaces that can easily be used in a declarative way. Both for my own benefit and for anyone maintaining my work later.

      STOP it's too much abstractions

      I do not agree. Abstractions are good. All code is abstraction. Web Components are great because you only ever need to solve a problem once. Then you can re-use that component any time you need it.

      The content becomes decoupled from it's components. You describe the parts of the page in pure HTML and implement the logic in an abstracted way. If you want to populate the content server-side, that's no problem. If you want to change the behavior, all the code is encapsulated into modules. You can drop a component into a simple test page with no framework or build steps required to work on it.

      everyday we see a new libraries doing magical things in the front stack, for example form validation, scroll behavior, even library for pagination

      You still need back-end validation but additional front-end form validation makes for a better user experience, especially when added to a custom form field.

      Modifying scroll behavior is certainly not something you would want to do on a typical informational website but it can create a much more immersive app-like experience. Check out the source of that page to see how abstracting this behavior can be done in a clean and elegant way.

      Pagination is actually a unique scenario. It's definitely easier to implement server-side, but you could absolutely package the behavior into a re-usable component. Something like this:

      <paged-content page="1" lastpage="10">
        <article> ... </article>
        <article> ... </article>
        <article> ... </article>
      </paged-content>
      
      Enter fullscreen mode Exit fullscreen mode

      In this example, you would populate the initial content and attributes in a server-side render. The page navigation would be part of the Shadow DOM just like how a <video> element adds it's own controls that are not part of your markup. This would allow you to declare your content and the component handles the heavy lifting. If you ever want to improve or even replace your component, it becomes a simple drop-in, plug-and-play change that automatically affects all instances.

  • Mark Ellis
    Mark EllisMay 7, 2025

    I remember web components from the old ie6 days, Firefox had them as well, but not standardised, nothing like they are now, time for a revisit, I’ve been sick of react for a long time. This seems like a good way to go, what’s your thoughts on Lit?

    • Besworks
      BesworksMay 9, 2025

      I mentioned Lit in another reply. For me it's an an abstraction layer that I don't need, but it definitely would be a good place to take your first steps into the world of Custom Elements if you're coming from React. You'll find similar syntax and concepts as well as excellent tutorials.

      There's also a solid library of components called Shoelace that's based on Lit which you can load via CDN. This would give you a good set of starter elements to work with if you don't feel like building your own toolkit from scratch.

  • MENU KFC United kingdom
    MENU KFC United kingdomMay 7, 2025

    KFC outlets not only serve delicious chicken meals but also have a sweet and tasty dessert menu. After enjoying your main food, you can choose from a variety of desserts to make your meal even better. Some popular treats include soft-serve ice cream, chocolate cake, and sundaes. These desserts are perfect for people of all ages who love something sweet. KFC outlets make sure that their dessert options are as enjoyable as their famous chicken.

    Image description

  • martin rojas
    martin rojasMay 8, 2025

    From a high level, it sounds nice and pretty, but the biggest hurdle for web components is that there isn't a clean and simple development flow for creating a complex application in web components.

    • Besworks
      BesworksMay 8, 2025

      I am really hoping to change that. I've been pitching a series of articles entitled Mastering Web Components to try and get paid for creating this content. If anyone reading this would like to discuss sponsoring this endeavor please contact me.

  • Nathan Tarbert
    Nathan TarbertMay 8, 2025

    man, i've felt the same way for a while - doing things the standard way just makes more sense to me now tbh

  • amy
    amyMay 8, 2025

    Cảm ơn. Tôi đã học được rất nhiều

  • Besworks
    BesworksMay 8, 2025

    I just want to thank everyone for engaging on this topic! This post has earned me the React badge.

    react badge screenshot

    But... @ben why is there no Web Components badge? I would much rather be sporting that on my profile instead.

  • DUONG Phu-Hiep
    DUONG Phu-HiepMay 10, 2025

    misleading article! writer thinks that WebComponents can solve all the problems that React try to solve and so we can use WebComponents to replace React. No it is the reverse.

    View frameworks (reactjs, vue, svelte, solidjs..) solved not only ALL problems which WebComponents are trying to solve but also much more problems that WebComponents don't want to solve: Reactivity system.

    Which means that in the SAME Application we can use these frameworks (react, vue, solidjs..) to replace WebComponents not the reverse.

    WebComponents will stays, But not many peoples will use it because it isn't helpful enough.

    • Besworks
      BesworksMay 11, 2025

      This is a misleading comment because not once did I ever say that Web Components alone are a magic bullet or that frameworks add no value to a stack. I have also addressed all of these points in other replies.

      If you read the entire discussion you will see that this post was just a precursor to a series of articles intended to debunk misinformation and misunderstanding on this subject with history, statistics, facts and tutorials.

  • Reid Burton
    Reid BurtonMay 15, 2025

    Umm... Safari WILL NOT EVER add the is= thing. which is a core of Web Components, also you can add Web Components in React.

    • Besworks
      BesworksMay 15, 2025

      Yes, Safari refused to implement is=, but browser vendors have agreed to work together to come up with an alternative. Meanwhile, that attribute was never necessary, customizing built in elements can be done by extending their classes.

      class MyButton extends HTMLButtonElement {}
      customElements.define('my-button', MyButton)
      
      Enter fullscreen mode Exit fullscreen mode

      And sure you can use Web Components with React. But why add the extra complexity? There are much lighter alternatives as have been pointed out in these comment numerous times.

Add comment