ReactFabric.js 790 B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * Copyright (c) Facebook, Inc. and its 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. * @format
  8. * @flow
  9. */
  10. 'use strict';
  11. import {BatchedBridge} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';
  12. // TODO @sema: Adjust types
  13. import type {ReactNativeType} from './ReactNativeTypes';
  14. let ReactFabric;
  15. if (__DEV__) {
  16. ReactFabric = require('../implementations/ReactFabric-dev');
  17. } else {
  18. ReactFabric = require('../implementations/ReactFabric-prod');
  19. }
  20. if (global.RN$Bridgeless) {
  21. global.RN$stopSurface = ReactFabric.stopSurface;
  22. } else {
  23. BatchedBridge.registerCallableModule('ReactFabric', ReactFabric);
  24. }
  25. module.exports = (ReactFabric: ReactNativeType);