mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Removed unnecessary exportedConstants
Summary: The exportedConstants method incurrs a penalty at bridge startup time for every module that implements it. This diff removes exportedConstants from a few modules that don't really need to use it. Reviewed By: majak Differential Revision: D2982341 fb-gh-sync-id: be016187d7b731a073311daacfcf88a0402e1688 shipit-source-id: be016187d7b731a073311daacfcf88a0402e1688
This commit is contained in:
committed by
Facebook Github Bot 5
parent
d71c05164c
commit
520ad05ba0
@@ -10,18 +10,11 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var ScrollViewConsts = require('UIManager').RCTScrollView.Constants;
|
||||
|
||||
function processDecelerationRate(decelerationRate) {
|
||||
var ScrollViewDecelerationRateNormal = ScrollViewConsts && ScrollViewConsts.DecelerationRate.normal;
|
||||
var ScrollViewDecelerationRateFast = ScrollViewConsts && ScrollViewConsts.DecelerationRate.fast;
|
||||
|
||||
if (typeof decelerationRate === 'string') {
|
||||
if (decelerationRate === 'fast') {
|
||||
return ScrollViewDecelerationRateFast;
|
||||
} else if (decelerationRate === 'normal') {
|
||||
return ScrollViewDecelerationRateNormal;
|
||||
}
|
||||
if (decelerationRate === 'normal') {
|
||||
decelerationRate = 0.998;
|
||||
} else if (decelerationRate === 'fast') {
|
||||
decelerationRate = 0.99;
|
||||
}
|
||||
return decelerationRate;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user