From a06c0da828f42b804b526a5de35b94b5b4468c1c Mon Sep 17 00:00:00 2001 From: nd-02110114 Date: Tue, 30 Oct 2018 12:38:26 -0700 Subject: [PATCH] Remove var in Libraries/Component (#22020) Summary: I removed `var` in Libraries/Component. - [x] npm run prettier - [x] npm run flow-check-ios - [x] npm run flow-check-android [GENERAL] [ENHANCEMENT] [Libraries/Component] - remove `var` Pull Request resolved: https://github.com/facebook/react-native/pull/22020 Differential Revision: D12843058 Pulled By: TheSavior fbshipit-source-id: 90723f3905191cbd29cb18474c700ac65f2503cd --- Libraries/Components/RefreshControl/RefreshControl.js | 5 +++-- Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Libraries/Components/RefreshControl/RefreshControl.js b/Libraries/Components/RefreshControl/RefreshControl.js index 0f3f4c857557df..98ce10af6d0d73 100644 --- a/Libraries/Components/RefreshControl/RefreshControl.js +++ b/Libraries/Components/RefreshControl/RefreshControl.js @@ -20,15 +20,16 @@ const nullthrows = require('nullthrows'); import type {ColorValue} from 'StyleSheetTypes'; import type {ViewProps} from 'ViewPropTypes'; +let RefreshLayoutConsts; if (Platform.OS === 'android') { const AndroidSwipeRefreshLayout = require('UIManager').getViewManagerConfig( 'AndroidSwipeRefreshLayout', ); - var RefreshLayoutConsts = AndroidSwipeRefreshLayout + RefreshLayoutConsts = AndroidSwipeRefreshLayout ? AndroidSwipeRefreshLayout.Constants : {SIZE: {}}; } else { - var RefreshLayoutConsts = {SIZE: {}}; + RefreshLayoutConsts = {SIZE: {}}; } type NativeRefreshControlType = Class>; diff --git a/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js b/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js index 7fc4fadeac9683..873573ad8a025c 100644 --- a/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js +++ b/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js @@ -132,20 +132,21 @@ class TabBarItemIOS extends React.Component { showedDeprecationWarning = true; } } - + render() { const {style, children, ...props} = this.props; // if the tab has already been shown once, always continue to show it so we // preserve state between tab transitions + let tabContents; if (this.state.hasBeenSelected) { - var tabContents = ( + tabContents = ( {children} ); } else { - var tabContents = ; + tabContents = ; } return (