How to write a class component in React

Component
By Jad Joubran · 
Last updated Jan 28, 2020
import React from "react";

class MyComponent extends React.Component {
  constructor(props) {
    super(props);
    //
  }

  render() {
    return <h1>This is a class component</h1>;
  }
}