2023-03-07
3361
#react
Kasra Khosravi
32679
Mar 7, 2023 â‹… 12 min read

Web components vs. React

Kasra Khosravi Founder at FeedbackOnSite.co.

Recent posts:

A Guide To Cookies In Next Js

A guide to cookies in Next.js

Cookies are crucial to web development. This article will explore how to handle cookies in your Next.js applications.

Georgey V B
Apr 30, 2024 â‹… 10 min read
Handling Dates In JavaScript With Tempo

Handling dates in JavaScript with Tempo

Use the Tempo library to format dates and times in JavaScript while accounting for time zones, daylight saying time, and date internationalization.

Amazing Enyichi Agu
Apr 30, 2024 â‹… 8 min read
A Guide To Deno.cron

A guide to Deno.cron

This guide explores how to use the cron package in Deno, `Deno.cron`, to handle scheduling tasks with specific commands.

Rosario De Chiara
Apr 29, 2024 â‹… 5 min read
Comparing Mutative Vs Immer Vs Reducers For Data Handling In React

Comparing React state tools: Mutative vs. Immer vs. reducers

Mutative processes data with better performance than both Immer and native reducers. Let’s compare these data handling options in React.

Rashedul Alam
Apr 26, 2024 â‹… 7 min read
View all posts

6 Replies to "Web components vs. React"

  1. You forgot to say we can pass easily data to react components while it is hard to do for webComponents. Only primitive arguments are supported and it is a pain to pass functions, objects or class instances.

  2. -Types of (React) components include functional and class. That’s not two types, but two ways of doing the same.
    -Types of (web) components include custom elements, shadow DOM, and templates. Shadow DOM it’s a property of custom elements and templates are not part of web components at all.
    -Components are reusable in React only. As long as they may be compiled as web components itself, how it’s this possible? I’m even using React components in Angular (without WC build).
    -The ecosystem is not as vast as React’s ecosystem. How can a Web standard not have a good ecosystem?
    -(React) It is a JavaScript library for building UI interfaces for single-page applications. That’s what it was intended to be, but people build entire SPAs with it, not just UI.
    -It is a set of different technologies that allow us to create reusable and isolated elements. It’s not a set of technologies, as it’s a Web standard and JavaScript is the only technology used. (Of course there are options that allow you to use more comfortable alternatives, like stencil, lit-element…)

  3. You can package the entire react componen as a JS lib and reuse in any App. Good ir bad idea… But you can do It.

  4. You are wrong here I am afraid. Web components have a JS interface which allows properties and any other complex argument to be passed.

    Many wc helper libraries like lit-element also provide convenience mechanisms to do this in just the same way you would in react.

Leave a Reply