DEV Community

Discussion on: Avoiding Race Conditions when Fetching Data with React Hooks

Collapse
 
n1ru4l profile image
Laurin Quast

Why would you not call this a race condition? Why would race conditions not occur in an event loop environment?

Collapse
 
nas5w profile image
Nick Scialli (he/him)

I have heard some people make the argument that race conditions can only happen in multithreaded environments by definition. I don’t really agree (or think it matters) as you’ll find plenty of people out there who would contend that multithreading is not required to be a race condition. At any rate, I’m not terribly interested in calling it a “condition in which there is a race” just to avoid what some might consider a reserved phrase.