3 ms·
From what I know React does not register event handlers on individual nodes, but rather on root component. Then it uses virtual events from it’s pool in your ca
by szastamasta 4y ago
From what I know React does not register event handlers on individual nodes, but rather on root component. Then it uses virtual events from it’s pool in your callbacks.
- kamikaz1k 4y agoWow, I didn't know this! All that Synethetic stuff makes sense in retrospect... I tried a quick google and didn't find any articles discussing it directly. Do you have any links to offer? Thanks in advance!
- szastamasta 4y agoCannot find a page about it in the docs, but here they discuss how it was changed from document root to React root in React 17: https://reactjs.org/blog/2020/08/10/react-v17-rc.html#changes-to-event-delegation https://reactjs.org/blog/2020/08/10/react-v17-rc.html#change...
- matvp 4y agoSide note, synthetic events are no longer pooled since React 17. There's no longer a noticable performance gain with more modern browsers nowadays.