My read is that useState is not going to change the initial value of a variable on second re-render, so we have to update the current tab based on a change in results, so using useEffect.
We should probably only move to the tab when new results appear, not every minute, but leaving that for an additional commit here.
My read is that
useState
is not going to change the initial value of a variable on second re-render, so we have to update the current tab based on a change inresults
, so usinguseEffect
.We should probably only move to the tab when new results appear, not every minute, but leaving that for an additional commit here.