title: Converting class to functional component while using interface
body: <p>I've the below code. How can I convert it from class component to functional component, minding that I would like to use interface instead of type?
  As well, I believe the empty type Props is not needed, right?</p>
  <pre><code>import { v4 as uuidv4 } from 'uuid';
  
  type Props = {};
  type State = {
    hasError: boolean;
    guid: string;
  };
  
  export class ErrorBoundary extends Component&lt;Props, State&gt; {
    constructor(props: Props) {
      super(props);
      this.state = {
        hasError: false,
        guid: uuidv4(),
      };
    }
  
    render() {
      if (this.state.hasError) {
        return &lt;&gt;Error&lt;/&gt;;
      }
  
      return this.props.children;
    }
  }
  }; 
  </code></pre>