Fix RefreshControl's dependency on AndroidSwipeRefreshLayout

Reviewed By: mdvacca

Differential Revision: D7185836

fbshipit-source-id: 726e6e6792f1f3971c2f7de9bb83ff888815220d
This commit is contained in:
Andrew Chen (Eng) 2018-03-07 18:34:51 -08:00 committed by Facebook Github Bot
parent 7bf3b20837
commit a162dc8cc6
1 changed files with 5 additions and 1 deletions

View File

@ -20,7 +20,11 @@ const createReactClass = require('create-react-class');
const requireNativeComponent = require('requireNativeComponent'); const requireNativeComponent = require('requireNativeComponent');
if (Platform.OS === 'android') { if (Platform.OS === 'android') {
var RefreshLayoutConsts = require('UIManager').AndroidSwipeRefreshLayout.Constants; const AndroidSwipeRefreshLayout =
require('UIManager').AndroidSwipeRefreshLayout;
var RefreshLayoutConsts = AndroidSwipeRefreshLayout
? AndroidSwipeRefreshLayout.Constants
: {SIZE: {}};
} else { } else {
var RefreshLayoutConsts = {SIZE: {}}; var RefreshLayoutConsts = {SIZE: {}};
} }