react/scripts/rollup/shims/react-native/ReactFabric.js

32 lines
762 B
JavaScript
Raw Normal View History

2018-02-13 02:12:46 +08:00
/**
* Copyright (c) Facebook, Inc. and its affiliates.
2018-02-13 02:12:46 +08:00
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
2018-02-13 02:12:46 +08:00
* @flow
*/
2018-02-13 02:12:46 +08:00
'use strict';
import {BatchedBridge} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';
import type {ReactFabricType} from './ReactNativeTypes';
2018-02-13 02:12:46 +08:00
let ReactFabric;
if (__DEV__) {
ReactFabric = require('../implementations/ReactFabric-dev');
2018-02-13 02:12:46 +08:00
} else {
ReactFabric = require('../implementations/ReactFabric-prod');
2018-02-13 02:12:46 +08:00
}
if (global.RN$Bridgeless) {
global.RN$stopSurface = ReactFabric.stopSurface;
} else {
BatchedBridge.registerCallableModule('ReactFabric', ReactFabric);
}
module.exports = (ReactFabric: ReactFabricType);