DEV Community

Discussion on: What's NOT new in React 18

Collapse
 
rejhgadellaa profile image
Roderick Gadellaa

Not sure what you mean with "black box magic". I always think of React as being exactly that (coming from someone who generally prefers vanilla instead of using frameworks)?

Thread Thread
 
jorenbroekema profile image
Joren Broekema

I meant that while React functional components may be very little code compared to the class-based HTMLElement or LitElement or what have you, it is worth having a bit more code if it means roughly no black box magic and it is interoperable and aligns with browser standards (DOM vs Virtual DOM to name an example)

Thread Thread
 
bennypowers profile image
Benny Powers 🇮🇱🇨🇦 • Edited

It's not either-or. There are many web component libraries with an FP flavour:

  • hybrids
  • haunted
  • FAST
  • atomico

Just off the top of my head.

Web Components !== OOP

You don't have to give up your functional programming style to use web components!

More importantly:

React isn't the only functional UI framework

Preact works just fine with the DOM and has for years.

OP is about web compat, not flaming FP or OOP styles.

Some comments have been hidden by the post's author - find out more