votingworks / election-results-reporting

GNU General Public License v3.0
1 stars 1 forks source link

useEffect for results --> tab switch #2

Closed benadida closed 3 years ago

benadida commented 3 years ago

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.