From 56031fe36c636bb87f3752929e615d9b47c3ec02 Mon Sep 17 00:00:00 2001 From: sarovin Date: Thu, 5 May 2016 17:42:03 +0200 Subject: [PATCH 1/2] FIX Deprecation in RN 0.25 --- Example/Example.js | 3 ++- Example/components/EchoView.js | 3 ++- Example/components/Error.js | 3 ++- Example/components/Home.js | 3 ++- Example/components/Launch.js | 5 +++-- Example/components/Login.js | 3 ++- Example/components/Login2.js | 3 ++- Example/components/NavigationDrawer.js | 4 +++- Example/components/Register.js | 3 ++- Example/components/TabIcon.js | 3 ++- Example/components/TabView.js | 3 ++- Example/components/TabView2.js | 3 ++- Example/index.android.js | 2 +- Example/index.ios.js | 2 +- src/DefaultRenderer.js | 8 +++++--- src/Modal.js | 2 ++ src/NavBar.js | 4 +++- src/Router.js | 6 ++++-- src/Scene.js | 2 +- src/Switch.js | 2 +- src/TabBar.js | 5 ++++- test/Actions.test.js | 2 +- test/Reducer.test.js | 2 +- 23 files changed, 50 insertions(+), 26 deletions(-) diff --git a/Example/Example.js b/Example/Example.js index 97783a69f..2a2f09d1c 100644 --- a/Example/Example.js +++ b/Example/Example.js @@ -1,4 +1,5 @@ -import React, {AppRegistry, Navigator, StyleSheet, Text, View} from 'react-native' +import React from 'react'; +import {AppRegistry, Navigator, StyleSheet, Text, View} from 'react-native' import Launch from './components/Launch' import Register from './components/Register' import Login from './components/Login' diff --git a/Example/components/EchoView.js b/Example/components/EchoView.js index f8674465f..e83e79885 100644 --- a/Example/components/EchoView.js +++ b/Example/components/EchoView.js @@ -1,4 +1,5 @@ -import React, {View, Text, StyleSheet} from "react-native"; +import React from 'react'; +import {View, Text, StyleSheet} from "react-native"; import Button from "react-native-button"; import {Actions} from "react-native-router-flux"; diff --git a/Example/components/Error.js b/Example/components/Error.js index afc72f672..42820a959 100644 --- a/Example/components/Error.js +++ b/Example/components/Error.js @@ -1,4 +1,5 @@ -import React, {View, Text, StyleSheet, Animated, Dimensions} from "react-native"; +import React from 'react'; +import {View, Text, StyleSheet, Animated, Dimensions} from "react-native"; import Button from "react-native-button"; import {Actions} from "react-native-router-flux"; diff --git a/Example/components/Home.js b/Example/components/Home.js index edf6b1ac7..beed44b6e 100644 --- a/Example/components/Home.js +++ b/Example/components/Home.js @@ -1,4 +1,5 @@ -import React, {View, Text, StyleSheet} from "react-native"; +import React from 'react'; +import {View, Text, StyleSheet} from "react-native"; import Button from "react-native-button"; import {Actions} from "react-native-router-flux"; diff --git a/Example/components/Launch.js b/Example/components/Launch.js index 3c062fe2e..16bea40e6 100644 --- a/Example/components/Launch.js +++ b/Example/components/Launch.js @@ -1,4 +1,5 @@ -import React, {View, Text, StyleSheet} from "react-native"; +import React from 'react'; +import {View, Text, StyleSheet} from "react-native"; import Button from "react-native-button"; import {Actions} from "react-native-router-flux"; @@ -27,4 +28,4 @@ class Launch extends React.Component { } } -module.exports = Launch; \ No newline at end of file +module.exports = Launch; diff --git a/Example/components/Login.js b/Example/components/Login.js index b0c40dc7b..46e8c6265 100644 --- a/Example/components/Login.js +++ b/Example/components/Login.js @@ -1,4 +1,5 @@ -import React, {View, Text, StyleSheet} from "react-native"; +import React from 'react'; +import {View, Text, StyleSheet} from "react-native"; import Button from "react-native-button"; import {Actions} from "react-native-router-flux"; diff --git a/Example/components/Login2.js b/Example/components/Login2.js index 573055d20..1af8e908c 100644 --- a/Example/components/Login2.js +++ b/Example/components/Login2.js @@ -1,4 +1,5 @@ -import React, {View, Text, StyleSheet} from "react-native"; +import React from 'react'; +import {View, Text, StyleSheet} from "react-native"; import Button from "react-native-button"; import {Actions} from "react-native-router-flux"; diff --git a/Example/components/NavigationDrawer.js b/Example/components/NavigationDrawer.js index 5898b6ce5..aca220116 100644 --- a/Example/components/NavigationDrawer.js +++ b/Example/components/NavigationDrawer.js @@ -1,4 +1,6 @@ -import React, {Component} from "react-native" +import React, { + Component, +} from 'react'; import TabView from "./TabView" import Drawer from "react-native-drawer" import {DefaultRenderer} from "react-native-router-flux"; diff --git a/Example/components/Register.js b/Example/components/Register.js index 940149e46..ba9e7d7ec 100644 --- a/Example/components/Register.js +++ b/Example/components/Register.js @@ -1,4 +1,5 @@ -import React, {View, Text, StyleSheet} from "react-native"; +import React from 'react'; +import {View, Text, StyleSheet} from "react-native"; import Button from "react-native-button"; import {Actions} from "react-native-router-flux"; diff --git a/Example/components/TabIcon.js b/Example/components/TabIcon.js index acc6906ef..467b24bdf 100644 --- a/Example/components/TabIcon.js +++ b/Example/components/TabIcon.js @@ -1,4 +1,5 @@ -import React, {Text} from "react-native"; +import React from 'react'; +import {Text} from "react-native"; export default class extends React.Component { render(){ return ( diff --git a/Example/components/TabView.js b/Example/components/TabView.js index a2d75d4ff..16d463991 100644 --- a/Example/components/TabView.js +++ b/Example/components/TabView.js @@ -1,4 +1,5 @@ -import React, {View, Text, StyleSheet} from "react-native"; +import React from 'react'; +import {View, Text, StyleSheet} from "react-native"; import Button from "react-native-button"; import {Actions} from "react-native-router-flux"; diff --git a/Example/components/TabView2.js b/Example/components/TabView2.js index c77d8c804..87f4bf448 100644 --- a/Example/components/TabView2.js +++ b/Example/components/TabView2.js @@ -1,4 +1,5 @@ -import React, {View, Text, StyleSheet} from "react-native"; +import React from 'react'; +import {View, Text, StyleSheet} from "react-native"; import Button from "react-native-button"; import {Actions} from "react-native-router-flux"; diff --git a/Example/index.android.js b/Example/index.android.js index 456a93e80..c84cf47bc 100644 --- a/Example/index.android.js +++ b/Example/index.android.js @@ -1,6 +1,6 @@ 'use strict'; -var React = require('react-native'); +var React = require('react'); var {AppRegistry, Navigator, StyleSheet,Text,View} = React; import Example from './Example'; diff --git a/Example/index.ios.js b/Example/index.ios.js index f282efeaf..ccbba01e5 100644 --- a/Example/index.ios.js +++ b/Example/index.ios.js @@ -1,6 +1,6 @@ 'use strict'; -var React = require('react-native'); +var React = require('react'); var {AppRegistry, Navigator, StyleSheet,Text,View} = React; import Example from './Example'; diff --git a/src/DefaultRenderer.js b/src/DefaultRenderer.js index 28b8767a2..f7795305d 100644 --- a/src/DefaultRenderer.js +++ b/src/DefaultRenderer.js @@ -6,11 +6,13 @@ * LICENSE file in the root directory of this source tree. * */ -import React, { - Animated, + import React, { Component, - NavigationExperimental, PropTypes, +} from 'react'; +import { + Animated, + NavigationExperimental, View, } from 'react-native'; diff --git a/src/Modal.js b/src/Modal.js index 334911df8..87eccc6c3 100644 --- a/src/Modal.js +++ b/src/Modal.js @@ -1,5 +1,7 @@ import React, { PropTypes, +} from 'react'; +import { View, } from 'react-native'; import DefaultRenderer from './DefaultRenderer'; diff --git a/src/NavBar.js b/src/NavBar.js index e88a159b0..d6d612b40 100644 --- a/src/NavBar.js +++ b/src/NavBar.js @@ -23,8 +23,10 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -import React, { + import React, { PropTypes, +} from 'react'; +import { Platform, Animated, Image, diff --git a/src/Router.js b/src/Router.js index 35acc7ffd..b16fd308a 100644 --- a/src/Router.js +++ b/src/Router.js @@ -6,10 +6,12 @@ * LICENSE file in the root directory of this source tree. * */ -import React, { + import React, { Component, - NavigationExperimental, PropTypes, +} from 'react'; +import { + NavigationExperimental, } from 'react-native'; import Actions from './Actions'; diff --git a/src/Scene.js b/src/Scene.js index 858760b7a..d978c8581 100644 --- a/src/Scene.js +++ b/src/Scene.js @@ -6,7 +6,7 @@ * LICENSE file in the root directory of this source tree. * */ -import React from 'react-native'; +import React from 'react'; export default class extends React.Component { render() { diff --git a/src/Switch.js b/src/Switch.js index c69739d3e..eb6f47f84 100644 --- a/src/Switch.js +++ b/src/Switch.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react-native'; +import React, { Component } from 'react'; import DefaultRenderer from './DefaultRenderer'; import Actions from './Actions'; diff --git a/src/TabBar.js b/src/TabBar.js index 478bd0785..b604cf163 100644 --- a/src/TabBar.js +++ b/src/TabBar.js @@ -1,4 +1,7 @@ -import React, { View, Component, NavigationExperimental } from 'react-native'; +import React, { + Component, +} from 'react'; +import { View, NavigationExperimental } from 'react-native'; import Tabs from 'react-native-tabs'; import DefaultRenderer from './DefaultRenderer'; import Actions from './Actions'; diff --git a/test/Actions.test.js b/test/Actions.test.js index 063b5466d..a7f0b11bc 100644 --- a/test/Actions.test.js +++ b/test/Actions.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import React from 'react-native'; +import React from 'react'; import Actions from '../src/Actions'; import Scene from '../src/Scene'; diff --git a/test/Reducer.test.js b/test/Reducer.test.js index c74564492..74764dde4 100644 --- a/test/Reducer.test.js +++ b/test/Reducer.test.js @@ -1,4 +1,4 @@ -import React from 'react-native'; +import React from 'react'; import { expect } from 'chai'; import Scene from '../src/Scene'; From d6e2116d7e2dbcc59409d5ceec5f3dde26e323a7 Mon Sep 17 00:00:00 2001 From: sarovin Date: Thu, 5 May 2016 20:02:38 +0200 Subject: [PATCH 2/2] FIX ESLint erorr --- src/DefaultRenderer.js | 2 +- src/NavBar.js | 2 +- src/Router.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DefaultRenderer.js b/src/DefaultRenderer.js index f7795305d..7b01bde78 100644 --- a/src/DefaultRenderer.js +++ b/src/DefaultRenderer.js @@ -6,7 +6,7 @@ * LICENSE file in the root directory of this source tree. * */ - import React, { +import React, { Component, PropTypes, } from 'react'; diff --git a/src/NavBar.js b/src/NavBar.js index d6d612b40..0900d46ce 100644 --- a/src/NavBar.js +++ b/src/NavBar.js @@ -23,7 +23,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ - import React, { +import React, { PropTypes, } from 'react'; import { diff --git a/src/Router.js b/src/Router.js index b16fd308a..cdb95476d 100644 --- a/src/Router.js +++ b/src/Router.js @@ -6,7 +6,7 @@ * LICENSE file in the root directory of this source tree. * */ - import React, { +import React, { Component, PropTypes, } from 'react';