Skip to content

Commit

Permalink
Remove var in Libraries/Component (#22020)
Browse files Browse the repository at this point in the history
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: #22020

Differential Revision: D12843058

Pulled By: TheSavior

fbshipit-source-id: 90723f3905191cbd29cb18474c700ac65f2503cd
  • Loading branch information
nissy-dev authored and facebook-github-bot committed Oct 30, 2018
1 parent 31bb551 commit a06c0da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Libraries/Components/RefreshControl/RefreshControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<NativeComponent<RefreshControlProps>>;

Expand Down
7 changes: 4 additions & 3 deletions Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,21 @@ class TabBarItemIOS extends React.Component<Props, State> {
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 = (
<StaticContainer shouldUpdate={this.props.selected}>
{children}
</StaticContainer>
);
} else {
var tabContents = <View />;
tabContents = <View />;
}

return (
Expand Down

1 comment on commit a06c0da

@semireg
Copy link

@semireg semireg commented on a06c0da Nov 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This fix has implications for flow-runtime. I've been hunting this one and glad to see it fixed. gajus/flow-runtime#216

Please sign in to comment.