title: useState not setting variable
body: <p>I am confused why <code>useState</code> is not setting the variable from its argument, <code>props</code>.</p>
  
  <p>The fragment is:</p>
  
  <pre><code>import React, { useState } from 'react';
  
  const FormContainer = (props) =&gt; {
    console.log('[FormContainer props]', props);   // line 7
    const [prevState, setPrevState] = useState(props);
    console.log('[FormContainer]', prevState);     // line 9
  </code></pre>
  
  <p><code>props</code> contains an object but the hook is not setting <code>prevState</code>. It is <code>undefined</code>. Why?</p>
  
  <p>Calling code. The first component presents a list. When a row in the list (grid) is clicked, this component gets the data and sends it as an argument to the second component, FormContainer.</p>
  
  <pre><code>import React, { Component } from 'react';
  import Table from './VehicleList';
  import VehicleForm from '../FormContainer';
  
  class Vehicles extends Component {
    state = {};
  
  ...
  
    render() {
      return (
        &lt;div&gt;
  
          {this.state &amp;&amp; this.state.vehicleList &amp;&amp; (
            &lt;Table vehicleList={this.state.vehicleList} clicked={this.vehicleSelectedHandler} /&gt;
          )}
          {console.log('[Vehicles render selectedVehicle]', this.state.selectedVehicle)}
          &lt;VehicleForm vehicle={this.state.selectedVehicle} /&gt;
        &lt;/div&gt;
      );
    }
  </code></pre>
  
  <p>From the debugger:</p>
  
  <p><a href="https://i.stack.imgur.com/0GB60.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0GB60.jpg" alt="Firefox dev tools"></a></p>