mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Remove var in RNTester (#22014)
Summary: I removed `var` in RNTester. - [x] npm run prettier - [x] npm run flow-check-ios - [x] npm run flow-check-android [GENERAL] [ENHANCEMENT] [RNTester] - remove `var` Pull Request resolved: https://github.com/facebook/react-native/pull/22014 Differential Revision: D12843150 Pulled By: TheSavior fbshipit-source-id: 593adf141164cffe0ddc2db756721df26e38b4f5
This commit is contained in:
committed by
Facebook Github Bot
parent
791fa2d83a
commit
5af577439b
@@ -9,9 +9,9 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
var React = require('react');
|
||||
var ReactNative = require('react-native');
|
||||
var {
|
||||
const React = require('react');
|
||||
const ReactNative = require('react-native');
|
||||
const {
|
||||
Image,
|
||||
StyleSheet,
|
||||
Text,
|
||||
@@ -23,9 +23,9 @@ var {
|
||||
|
||||
import type {ViewPagerScrollState} from 'ViewPagerAndroid';
|
||||
|
||||
var PAGES = 5;
|
||||
var BGCOLOR = ['#fdc08e', '#fff6b9', '#99d1b7', '#dde5fe', '#f79273'];
|
||||
var IMAGE_URIS = [
|
||||
const PAGES = 5;
|
||||
const BGCOLOR = ['#fdc08e', '#fff6b9', '#99d1b7', '#dde5fe', '#f79273'];
|
||||
const IMAGE_URIS = [
|
||||
'https://apod.nasa.gov/apod/image/1410/20141008tleBaldridge001h990.jpg',
|
||||
'https://apod.nasa.gov/apod/image/1409/volcanicpillar_vetter_960.jpg',
|
||||
'https://apod.nasa.gov/apod/image/1409/m27_snyder_960.jpg',
|
||||
@@ -43,7 +43,7 @@ class LikeCount extends React.Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
var thumbsUp = '\uD83D\uDC4D';
|
||||
const thumbsUp = '\uD83D\uDC4D';
|
||||
return (
|
||||
<View style={styles.likeContainer}>
|
||||
<TouchableOpacity onPress={this.onClick} style={styles.likeButton}>
|
||||
@@ -79,9 +79,10 @@ class Button extends React.Component {
|
||||
|
||||
class ProgressBar extends React.Component {
|
||||
render() {
|
||||
var fractionalPosition =
|
||||
const fractionalPosition =
|
||||
this.props.progress.position + this.props.progress.offset;
|
||||
var progressBarSize = (fractionalPosition / (PAGES - 1)) * this.props.size;
|
||||
const progressBarSize =
|
||||
(fractionalPosition / (PAGES - 1)) * this.props.size;
|
||||
return (
|
||||
<View style={[styles.progressBarContainer, {width: this.props.size}]}>
|
||||
<View style={[styles.progressBar, {width: progressBarSize}]} />
|
||||
@@ -118,7 +119,7 @@ class ViewPagerAndroidExample extends React.Component {
|
||||
};
|
||||
|
||||
move = delta => {
|
||||
var page = this.state.page + delta;
|
||||
const page = this.state.page + delta;
|
||||
this.go(page);
|
||||
};
|
||||
|
||||
@@ -133,9 +134,9 @@ class ViewPagerAndroidExample extends React.Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
var pages = [];
|
||||
for (var i = 0; i < PAGES; i++) {
|
||||
var pageStyle = {
|
||||
const pages = [];
|
||||
for (let i = 0; i < PAGES; i++) {
|
||||
const pageStyle = {
|
||||
backgroundColor: BGCOLOR[i % BGCOLOR.length],
|
||||
alignItems: 'center',
|
||||
padding: 20,
|
||||
@@ -150,7 +151,7 @@ class ViewPagerAndroidExample extends React.Component {
|
||||
</View>,
|
||||
);
|
||||
}
|
||||
var {page, animationsAreEnabled} = this.state;
|
||||
const {page, animationsAreEnabled} = this.state;
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<ViewPagerAndroid
|
||||
@@ -222,7 +223,7 @@ class ViewPagerAndroidExample extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
var styles = StyleSheet.create({
|
||||
const styles = StyleSheet.create({
|
||||
buttons: {
|
||||
flexDirection: 'row',
|
||||
height: 30,
|
||||
|
||||
Reference in New Issue
Block a user