title: How do I export more than one class component with React JS?
body: <p>I'm new to React and would like to keep all my components in one file.  How do I export more than one component and keep them in the same file?</p>
  
  <pre><code>    import React, { Component } from "react";
  
  class MyText extends Component {
    render() {
      return (&lt;div&gt;
        &lt;h1&gt;
          Component&lt;/h1&gt;
        &lt;p&gt;This class component is named MyText. I can re-use it's code by simply Rendering (fancy name for calling) it by it's class name and I won't have to re type it, however many times I will need it.&lt;/p&gt;
      &lt;/div&gt;);
    };
  }
  
  class GreetName extends Component {
    render() {
      return (
        &lt;div&gt;
         &lt;h1&gt;Hello, {this.props.name}&lt;/h1&gt;;
         &lt;/div&gt;
      );
    };
  }
  
  export default MyText;
  </code></pre>