title: How to specify a constructor with a functional component (fat arrow syntax)?
body: <p>Given this component:</p>
  
  <pre><code>import React from 'react'
  import ReactDOM from 'react-dom'
  import PropTypes from 'prop-types'
  
  const NewGoalInput = props =&gt; {
    return (
      &lt;input type="text" onKeyUp={handleKeyUp}/&gt;
    )
  }
  
  const handleKeyUp = (e) =&gt; {
    if (e.key === "Enter") {
      // TODO Add goal
    }
  }
  
  export default NewGoalInput
  </code></pre>
  
  <p>How do I add a constructor where I can define the state without using the <code>extends React.Component</code> syntax?</p>