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
medium
React
Why does componentDidCatch (not getDerivedStateFromError) hold the error-logging side effect?
A
componentDidCatch runs first
B
getDerivedStateFromError runs during the render phase and must stay pure, exactly like the rest of render — side effects belong in the commit phase
C
getDerivedStateFromError cannot access the error object
D
There's no functional difference — it's arbitrary convention
Check Answer