title: Variable derived from React redux useSelector in useCallback dependency array causes infinite re-rendering
body: <p>I have a list <code>topics</code> derived from <code>useSelector</code> and I use it in one of my callback function <code>updateXXX</code> and add it into the <code>useCallback</code> array of dependencies, unfortunately it causes infinite rendering. Can someone give me some suggestions? How am I supposed to solve the issue?</p>
  <pre><code>const topics = useSelector(...);
  
  const updateXXX = useCallback(() =&gt; {
      const filteredTopics = topics.filter(...);
  }, [topics]);
  </code></pre>
  <p>AFAIK, for <code>useState()</code></p>
  <blockquote>
  <p>React guarantees that setState function identity is stable and won’t change on re-renders. This is why it’s safe to omit from the useEffect or useCallback dependency list.</p>
  </blockquote>
  <p>My question is do we need to add the return value <code>topics</code> from <code>useSelector()</code> into any dependencies array?</p>
  <p>I observed that the infinite rendering happens only when <code>topics</code> is an empty list <code>[]</code></p>