mirror of
https://github.com/status-im/react-native.git
synced 2025-01-21 23:09:22 +00:00
cbb7c7c193
Reviewed By: mdvacca Differential Revision: D7373722 fbshipit-source-id: 3cd051f38677900693f3da797effa11f9161df37
26 lines
641 B
JavaScript
26 lines
641 B
JavaScript
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @providesModule requireFabricView
|
|
* @flow
|
|
* @format
|
|
*/
|
|
'use strict';
|
|
|
|
/**
|
|
* This is a switch on the correct view to use for Fabric
|
|
*/
|
|
module.exports = (name: string, fabric: boolean) => {
|
|
switch (name) {
|
|
case 'View':
|
|
return fabric ? require('FabricView') : require('View');
|
|
case 'Text':
|
|
return fabric ? require('FabricText') : require('Text');
|
|
default:
|
|
throw new Error(name + ' is not supported by Fabric yet');
|
|
}
|
|
};
|