title: Cannot update a component (SsbContextProvider) while rendering a different component (SortingDropDownMenu). To locate the bad setState()
body: <p>Why does this code give error:</p>
  <blockquote>
  <p>Cannot update a component (<code>SsbContextProvider</code>) while rendering a different component (<code>SortingDropDownMenu</code>). To locate the bad <code>setState()</code> call inside <code>SortingDropDownMenu</code>, follow the stack trace as described in.</p>
  </blockquote>
  <p><code>setSorting</code> and <code>sortArray</code> are both functions I have stored in my context.</p>
  <pre><code>const handleSelectChange = (event) =&gt; {
      setSorting(event.target.value)
  }
  useMemo(() =&gt; {
      if (fetched === true) {
          sortArray()
      }
  }, [sorting])
  </code></pre>