dillon1000/react

Commit

Removed unused imperative events implementation from React Native renderer (#26282)

## Summary

I'm going to start implementing parts of this proposal
https://github.com/react-native-community/discussions-and-proposals/pull/607

As part of that implementation I'm going to refactor a few parts of the
interface between React and React Native. One of the main problems we
have right now is that we have private parts used by React and React
Native in the public instance exported by refs. I want to properly
separate that.

I saw that a few methods to attach event handlers imperatively on refs
were also exposing some things in the public instance (the
`_eventListeners`). I checked and these methods are unused, so we can
just clean them up instead of having to refactor them too. Adding
support for imperative event listeners is in the roadmap after this
proposal, and its implementation might differ after this refactor.

This is essentially a manual revert of #23386.

I'll submit more PRs after this for the rest of the refactor.

## How did you test this change?

Existing jest tests. Will test a React sync internally at Meta.
Browse files
Changed paths10 files
First-parent comparison
M packages/react-native-renderer/src/ReactFabricEventEmitter.js ModifiedM packages/react-native-renderer/src/ReactFabricHostConfig.js ModifiedM packages/react-native-renderer/src/ReactNativeBridgeEventPlugin.js ModifiedM packages/react-native-renderer/src/ReactNativeEventEmitter.js ModifiedA packages/react-native-renderer/src/ReactNativeGetListener.js AddedD packages/react-native-renderer/src/ReactNativeGetListeners.js DeletedD packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/CustomEvent.js DeletedM packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js ModifiedD packages/react-native-renderer/src/legacy-events/PropagationPhases.js DeletedM scripts/flow/react-native-host-hooks.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…