mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-04 09:27:53 +08:00
Summary: The `UIManager` already has a lot of responsibilities and is deeply tied with React Native's view architecture. This diff separates out a `DeviceInfo` native module to provide information about screen dimensions and font scale, etc. Reviewed By: fkgozali Differential Revision: D4713834 fbshipit-source-id: f2ee93acf876a4221c29a8c731f5abeffbb97974
21 lines
572 B
JavaScript
21 lines
572 B
JavaScript
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule DeviceInfo
|
|
* @flow
|
|
*/
|
|
'use strict';
|
|
|
|
const DeviceInfo = require('NativeModules').DeviceInfo;
|
|
|
|
const invariant = require('invariant');
|
|
|
|
invariant(DeviceInfo, 'DeviceInfo native module is not installed correctly');
|
|
|
|
module.exports = DeviceInfo;
|