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 mutating a state array in place (items.push(x)) often fail to trigger a re-render?
A
push() is broken in React apps
B
React compares the new state value by reference; mutating in place keeps the SAME reference, so React's change-detection sees no difference
C
Arrays cannot be used as state at all
D
You must always call setState twice for arrays
Check Answer