title: React: Can't export const
body: <p>I'm trying to one line export const my <code>&lt;SearchForm/&gt;</code> but for some reason it's erroring out.</p>
  
  <p>Here is my code</p>
  
  <pre><code>import React from 'react';
  
  export const SearchForm = props =&gt; (
    &lt;form className="search-form" onSubmit={props.onSubmit}&gt;
      &lt;input placeholder="Username" type="text" value={props.value} onChange={props.onChange}&gt;&lt;/input&gt;
      &lt;input type="submit" value="Search"&gt;&lt;/input&gt;
    &lt;/form&gt;)
  
  SearchForm.propTypes = {
    onSubmit: React.PropTypes.func.isRequired,
    value: React.PropTypes.string.isRequired,
    onChange: React.PropTypes.func.isRequired
  }
  </code></pre>
  
  <blockquote>
    <p>React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in. Check the render method of <code>Home</code>.</p>
  </blockquote>
  
  <p>It's fine if I do <code>const SearchForm = props =&gt; .....</code> and <code>export default &lt;SearchForm/&gt;</code> at the bottom. I've also tried <code>export default SearchForm...</code> and other variations.</p>
  
  <p>I'm following an egghead.io tutorial and the guys using the exact same syntax so I have no idea what's wrong? Here's his code</p>
  
  <p><a href="https://i.stack.imgur.com/HcmLU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HcmLU.png" alt="enter image description here"></a></p>