1. /**
    
  2.  * Copyright (c) Meta Platforms, Inc. and affiliates.
    
  3.  *
    
  4.  * This source code is licensed under the MIT license found in the
    
  5.  * LICENSE file in the root directory of this source tree.
    
  6.  *
    
  7.  * @flow
    
  8.  */
    
  9. 
    
  10. import './ReactNativeInjectionShared';
    
  11. 
    
  12. import {
    
  13.   getFiberCurrentPropsFromNode,
    
  14.   getInstanceFromNode,
    
  15.   getNodeFromInstance,
    
  16. } from './ReactNativeComponentTree';
    
  17. import {setComponentTree} from './legacy-events/EventPluginUtils';
    
  18. import {receiveEvent, receiveTouches} from './ReactNativeEventEmitter';
    
  19. import ReactNativeGlobalResponderHandler from './ReactNativeGlobalResponderHandler';
    
  20. import ResponderEventPlugin from './legacy-events/ResponderEventPlugin';
    
  21. 
    
  22. // Module provided by RN:
    
  23. import {RCTEventEmitter} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';
    
  24. 
    
  25. /**
    
  26.  * Register the event emitter with the native bridge
    
  27.  */
    
  28. RCTEventEmitter.register({
    
  29.   receiveEvent,
    
  30.   receiveTouches,
    
  31. });
    
  32. 
    
  33. setComponentTree(
    
  34.   getFiberCurrentPropsFromNode,
    
  35.   getInstanceFromNode,
    
  36.   getNodeFromInstance,
    
  37. );
    
  38. 
    
  39. ResponderEventPlugin.injection.injectGlobalResponderHandler(
    
  40.   ReactNativeGlobalResponderHandler,
    
  41. );