Reverted commit D3580025

Reviewed By: mhorowitz

Differential Revision: D3580025

fbshipit-source-id: 4422b6b97ef844158e369e022d62d6f0ae641222
This commit is contained in:
Pieter De Baets
2016-08-02 14:09:30 -07:00
committed by Facebook Github Bot 3
parent ed89d5ba0d
commit b83ccb5749
6 changed files with 40 additions and 150 deletions

View File

@@ -16,9 +16,8 @@ const NativeModules = require('NativeModules');
const { UIManager } = NativeModules;
const findNodeHandle = require('react/lib/findNodeHandle');
const invariant = require('fbjs/lib/invariant');
invariant(UIManager, 'UIManager is undefined. The native module config is probably incorrect.');
const _takeSnapshot = UIManager.takeSnapshot;
/**
* Capture an image of the screen, window or an individual view. The image
@@ -40,13 +39,12 @@ invariant(UIManager, 'UIManager is undefined. The native module config is probab
UIManager.takeSnapshot = async function(
view ?: 'window' | ReactElement<any> | number,
options ?: {
width ?: number,
height ?: number,
format ?: 'png' | 'jpeg',
quality ?: number,
width ?: number;
height ?: number;
format ?: 'png' | 'jpeg';
quality ?: number;
},
) {
const _takeSnapshot = UIManager.takeSnapshot;
if (!_takeSnapshot) {
console.warn('UIManager.takeSnapshot is not available on this platform');
return;