Event
A UI event that can be dispatched to JS.
For dispatching events getEventData
should be used. Once event object is passed to the EventDispatched it should no longer be used as EventDispatcher may decide to recycle that object (by calling dispose).
If you need advanced customizations and overriding only getEventData
doesn't work for you, you must override both dispatch
and dispatchModern
. Both of these will be deleted in the distant future and it is highly recommended to use only getEventData
.
Old, pre-Fabric Events only used viewTag as the identifier, but Fabric needs surfaceId as well as viewTag. You may use UIManagerHelper.getSurfaceId
on a Fabric-managed View to get the surfaceId. Fabric will work without surfaceId - making Event
backwards-compatible - but Events without SurfaceId are slightly slower to propagate.