title: Infinite loop in useEffect
body: <p>I've been playing around with the new hook system in React 16.7-alpha and get stuck in an infinite loop in useEffect when the state I'm handling is an object or array.</p>
  
  <p>First, I use useState and initiate it with an empty object like this:</p>
  
  <pre><code>const [obj, setObj] = useState({});
  </code></pre>
  
  <p>Then, in useEffect, I use setObj to set it to an empty object again. As a second argument I'm passing [obj], hoping that it wont update if the <strong>content</strong> of the object hasn't changed. But it keeps updating. I guess because no matter the content, these are always different objects making React thinking it keep changing?</p>
  
  <pre><code>useEffect(() =&gt; {
    setIngredients({});
  }, [ingredients]);
  </code></pre>
  
  <p>The same is true with arrays, but as a primitive it wont get stuck in a loop, as expected.</p>
  
  <p>Using these new hooks, how should I handle objects and array when checking weather the content has changed or not?</p>