title: TypeError: Invalid attempt to destructure non-iterable instance React/Jest
body: <p>I am trying to do a SnapShot verification using Jest for my React App for one of the functional component. Here is the component and test file using Jest</p>
  
  <pre><code>import React, { useState } from 'react';
  import useForm from 'react-hook-form';
  import { useAppState } from 'Shared/store';
  ...
  
  const Form = () =&gt; {
  
  const {customReducer, dispatch} = useAppState();
  const { register, handleSubmit, errors, reset } = useForm({});
  
  //custom form methods
  
  return (
  &lt;&gt;
     &lt;Form ...&gt;
       ...
     &lt;/Form&gt;
     ....
  &lt;/&gt;
  );
  export default Form;
  </code></pre>
  
  <p>and my test using Jest</p>
  
  <pre><code>import React from 'react';
  import TestRenderer from 'react-test-renderer';
  import ShallowRenderer from 'react-test-renderer/shallow';
  import Form from '../form';
  
  describe('&lt;Form /&gt;', () =&gt; {
      test('Snapshot', () =&gt; {
      const tree = TestRenderer.create(&lt;Form /&gt;).toJSON();
      expect(tree).toMatchSnapshot();
    });
  });
  </code></pre>
  
  <p>and i was getting below error 
  TypeError: Invalid attempt to destructure non-iterable instance</p>
  
  <p>Tried with Enzyme as well but getting the same error. Spend good time in referring other related questions but couldn't figure out. Thank you. </p>