Skip to content

Instantly share code, notes, and snippets.

building stuff

Viliam Simko vsimko

building stuff
View GitHub Profile
indiesquidge /
Last active Aug 4, 2020
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() {
    <h1>Hello, {}</h1>
You can’t perform that action at this time.