title: Setting state fo multi step form using React Hooks Helper (link to codesandbox)
body: <p>I am trying to build a registration page using react hook helper.Unable to use SetForm for storing the base64 string generated. Able to retain the state by going next and previous as well.Thank you for your responses.
  The link to the project : <a href="https://codesandbox.io/s/billowing-cherry-yvj90?file=/src/Second.js" rel="nofollow noreferrer">https://codesandbox.io/s/billowing-cherry-yvj90?file=/src/Second.js</a></p>
  <p>MultiStepForm.js</p>
  <pre><code>import { useForm, useStep } from &quot;react-hooks-helper&quot;
  
  const defaultData = {
      FIRST_NAME: &quot;&quot;,
      LAST_NAME: &quot;&quot;,
      PHOTO: &quot;&quot;,
  
  const steps = [
      { id: 'details' },
      { id: 'photo' },
  ]
  const RegistrationMultiStepForm = () =&gt; {
  
      const [formData, setForm] = useForm(defaultData);
      const props = { formData, setForm, navigation }
      const { step, navigation } = useStep({
          steps,
          initialStep: 0
      })
      switch (step.id) {
          case 'details':
              return &lt;Registration_First {...props} /&gt;
  
          case 'photo':
              return &lt;Registration_Second {...props} /&gt;
  
      }
  </code></pre>
  <p>Registration_First.js</p>
  <pre><code>     const Registration_First = ({ formData, setForm, navigation }) =&gt; {
       const { FIRST_NAME, LAST_NAME } = formData;
         &lt;input
          placeholder='Enter your details'
          type='text'
          name=&quot;FIRST_NAME&quot;
          onChange={setForm}
          value={FIRST_NAME} /&gt;
  
       &lt;button onClick={() =&gt; navigation.next()}
  
  </code></pre>
  <p>Registration_Second.js (here I am unbale to set the value for photo..). The {result} is the base64 image string which I am trying to add to my state i.e setForm for assigning the value of PHOTO field.</p>
  <pre><code>configuration same as Registration_First
  
   const Cropped = () =&gt; {
  
  // this does not work which is the correct way 
     setForm((previousState) =&gt; {
        previousState.PHOTO = result
        return previousState
     })
  
  //this works...wrong way
     formData.PHOTO = result;
  }
  
                                               
  </code></pre>
  <p>What i expect&quot;: On update of {result} value with the base64 string, i want to call the setForm action and pass the value of {result} to my PHOTO field.</p>