DEV Community

Discussion on: Web Component ideas: Making an if element

Collapse
 
tylermorales profile image
Tyler Morales

Is there a more functional approach to writing the JavaScript as compared to the classes?

Collapse
 
taybenlor profile image
Ben Taylor

The Web Component API is pretty strongly bound to classes. For example, registering a custom element ensures the argument is a class. There are some libraries which will help you compile to Web Components as a target. But there’s nothing like (for example) a React pure function component.