title: React: How to use setState inside functional component?
body: <p>I am learning React. I read an article that suggests us to use functional component instead of class that extends React.Component, so I followed. I also use the arrow function instead of function keyword. That is:</p>
  <pre><code>const MyComponent = (props) =&gt; {...}
  </code></pre>
  <p>I got a structure that has 20 properties like:</p>
  <pre><code>{
      id: '',
      firstname: '',
      lastname: '', 
      ...
  }
  </code></pre>
  <p>I am using if ... else if ... to set the state, but I saw some examples that use this.setState() in just one line of code. I try to import setState from 'react', but fail.</p>
  <p>Is there a way to use setState() instead of setName(), setId(), ..., etc? Or any suggestion?</p>
  <p>Thank you very much!</p>