Files
react-native/private/react-native-fantom
Samuel Susla 9ebb3259f0 Add getDefinedEventHandlers API (#55861)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55861

Add `Fantom.getDefinedEventHandlers(element)` which returns the names of event handlers registered on a component. It Reads committed memoizedProps from the React fiber, so it works for any component type — including component-specific events like ScrollView's onScroll.

The alternative we considered was reading the ViewEvents bitmap from `BaseViewProps` in the ShadowNode (C++). That approach only covers View-specific touch/pointer events and onLayout; it misses component-specific events dispatched imperatively (e.g. ScrollView's onScroll), requiring a separate codepath per component type.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D94936370

fbshipit-source-id: f48b6e37a9e7cf252f396db69e1a43ecca82db96
2026-03-03 23:53:36 -08:00
..
2026-03-03 09:28:25 -08:00
2025-06-26 11:03:20 -07:00