title: Why can't I call setProps() on a component returning a list of divs in enzymejs?
body: <p>I have an issue understanding how <code>setProps</code> is meant to work in enzymejs library.</p>
  
  <p>To start with an example:</p>
  
  <pre><code>const CompA = (props) =&gt; {
      return props.listOfNumbers.map((number) =&gt; &lt;div&gt;{number}&lt;/div&gt;);
  };
  
  it("Test CompA", () =&gt; {
      const wrapper = shallow(&lt;CompA listOfNumbers={[1]}/&gt;);  // -&gt; (Debug log) ShallowWrapper {length: 1}
      wrapper.setProps({listOfNumbers: [1, 2]});              // -&gt; (Debug log) ShallowWrapper {length: 2}
      wrapper.setProps({listOfNumbers: [1, 2, 3]}); // Enzyme error:  Method “rerender” is meant to be run on 1 node. 2 found instead.
  });
  </code></pre>
  
  <p>From enzymejs docs.</p>
  
  <p><code>setProps: A method that sets the props of the root component, and re-renders.</code></p>
  
  <p>So, I assume the root component is checked within the <code>ShallowWrapper</code> returned from <code>shallow</code> function.
  And, if I understand the above enzyme error correctly, it is complaining that I am trying to call <code>setProps</code> on a wrapper which has a list of nodes, not a node.</p>
  
  <p>But, my confusion is, shouldn't I be able to call <code>setProps</code> on <code>CompA</code> and test the output of it's render function, whatever that output is?</p>
  
  <p>My impression here is, I can call <code>setProps</code> only if the component under test returns one node from it's render function. And that <strong>one node</strong> is the <strong>root component</strong> mentioned in enzyme doc.</p>