Skip to content

Instantly share code, notes, and snippets.

View vsimko's full-sized avatar
💭
building stuff

Viliam Simko vsimko

💭
building stuff
View GitHub Profile
@indiesquidge
indiesquidge / objects-over-classes.md
Last active January 17, 2024 09:30
We are better off avoiding ES6 classes in JavaScript when possible

Plain JavaScript objects are better than classes when they can be used, and many popular modern frameworks have adopted their use.

Consider that in React a component can be created as either a class or as an object.

// using a class
class Welcome extends React.Component {
  render() {
 Hello, {this.props.name}