Event Pooling
Note
This page is only relevant for React 16 and earlier, and for React Native.
React 17 on the web does not use event pooling.
Read more about this change in React 17.
The SyntheticEvent
objects are pooled. This means that the SyntheticEvent
object will be reused and all properties will be nullified after the event handler has been called. For example, this won't work:
If you need to access event object's properties after the event handler has run, you need to call e.persist()
:
Last updated