Igor
Data Race in a useEffect
Problem: If this runs right after I created a project, it will trigger the if statement that sends the user to the review tab:
if (refetchTries >= 2) {
setTab('review')
}
However, if I refresh the page or try again, it will work.
If I run it after I delete a project, the duplicate tab will appear for ~1 second, and then it will go to review, showing that there is a delay for the data to update.
This has not happened before, and I am not sure how I can ensure the data is updated when this runs. Any ideas?2 replies