DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
React Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
hard
React
A component fetches data in an effect keyed to userId. What bug can occur if userId changes again before the first fetch resolves?
A
Nothing — React automatically cancels the first request
B
A race condition: the first (now stale) request's response can arrive after the second and incorrectly overwrite the current data
C
The component will throw a Rules-of-Hooks error
D
The second fetch will never fire
Check Answer