QuizNot attempted
DOM ref inside an effect
1–4 to choose, Enter to submit
Show answer & explanation
Correct answer:
INPUT
- React attaches refs during the commit phase, before running effects, so
inputRef.currentis the<input>node andtagNameis'INPUT'. - Not undefined/null:
nullis only seen during render, before commit. - Not 'throws': the node exists by the time effects run.