Fix a warning about SnapshotView

Reviewed By: majak

Differential Revision: D2553669

fb-gh-sync-id: 2a2b47f9cf7a75403e4e2541b32a4b141b3d08be
This commit is contained in:
Pieter De Baets 2015-10-19 06:08:57 -07:00 committed by facebook-github-bot-6
parent b09e92e1b3
commit 59e670e453
1 changed files with 5 additions and 2 deletions

View File

@ -14,7 +14,7 @@
var Platform = require('Platform');
var React = require('React');
var StyleSheet = require('StyleSheet');
var { TestModule } = require('NativeModules');
var { TestModule, UIManager } = require('NativeModules');
var View = require('View');
var requireNativeComponent = require('requireNativeComponent');
@ -51,7 +51,10 @@ var style = StyleSheet.create({
},
});
var RCTSnapshot = Platform.OS === 'ios' ?
// Verify that RCTSnapshot is part of the UIManager since it is only loaded
// if you have linked against RCTTest like in tests, otherwise we will have
// a warning printed out
var RCTSnapshot = UIManager.RCTSnapshot ?
requireNativeComponent('RCTSnapshot', SnapshotViewIOS) :
View;