React · Senior · Question 65 of 75
Where does React (17+) attach its event listeners?
- ✓Correct answer: To the root container passed to
createRoot, not todocumentor each element - 2To every element with an
onClick - 3To
window
Explanation
Attaching to the root made it possible to run several React versions or apps on one page, and e.stopPropagation() now also stops bubbling to native document listeners.