From 9971ea325e12b1c50a4e7c5a280ad2d9f96e890f Mon Sep 17 00:00:00 2001 From: James McCarthy Date: Mon, 23 May 2016 16:09:25 -0400 Subject: [PATCH] Make compatible with RN 0.26.1 --- src/index.js | 34 +++++++++++++++++----------------- src/styles.js | 3 +-- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/index.js b/src/index.js index be14580..5258cf6 100644 --- a/src/index.js +++ b/src/index.js @@ -1,14 +1,14 @@ 'use strict'; -var React = require('react-native'); +import React, { Component, } from 'react'; var tweenState = require('react-tween-state'); -var { +import { Image, StyleSheet, TouchableHighlight, View -} = React; +} from 'react-native'; var styles = require('./styles'); var images = require('./images'); @@ -18,31 +18,31 @@ var SPIN_DURATION = 1000; var ProgressHUDMixin = { getInitialState() { return { - is_hud_visible: false + is_hud_visible: false, }; }, showProgressHUD() { this.setState({ - is_hud_visible: true + is_hud_visible: true, }); }, dismissProgressHUD() { this.setState({ - is_hud_visible: false + is_hud_visible: false, }); }, childContextTypes: { showProgressHUD: React.PropTypes.func, - dismissProgressHUD: React.PropTypes.func + dismissProgressHUD: React.PropTypes.func, }, getChildContext() { return { showProgressHUD: this.showProgressHUD, - dismissProgressHUD: this.dismissProgressHUD + dismissProgressHUD: this.dismissProgressHUD, }; }, }; @@ -52,11 +52,11 @@ var ProgressHUD = React.createClass({ contextTypes: { showProgressHUD: React.PropTypes.func.isRequired, - dismissProgressHUD: React.PropTypes.func + dismissProgressHUD: React.PropTypes.func, }, statics: { - Mixin: ProgressHUDMixin + Mixin: ProgressHUDMixin, }, propTypes: { @@ -98,7 +98,7 @@ var ProgressHUD = React.createClass({ this.tweenState('rotate_deg', { easing: tweenState.easingTypes.linear, duration: SPIN_DURATION, - endValue: this.state.rotate_deg === 0 ? 360 : this.state.rotate_deg + 360 + endValue: this.state.rotate_deg === 0 ? 360 : this.state.rotate_deg + 360, }); }, @@ -124,7 +124,7 @@ var ProgressHUD = React.createClass({ @@ -154,7 +154,7 @@ var ProgressHUD = React.createClass({ /*jshint ignore:end */ ); - } + }, }); diff --git a/src/styles.js b/src/styles.js index a1ef744..bcd742d 100644 --- a/src/styles.js +++ b/src/styles.js @@ -1,8 +1,7 @@ 'use strict'; -var React = require('react-native'); -var { StyleSheet } = React; +import { StyleSheet } from 'react-native'; var styles = StyleSheet.create({ overlay: {