From e304cd0032a8090510cd52bfdcb9fe560f012b91 Mon Sep 17 00:00:00 2001 From: Scott Kyle Date: Mon, 16 May 2016 13:21:55 -0700 Subject: [PATCH] Fix some warnings in benchmark app from RN upgrade --- examples/ReactNativeBenchmarks/benchmarks.js | 13 +++++----- .../ReactNativeBenchmarks/index.android.js | 26 +++++++++++++++---- examples/ReactNativeBenchmarks/index.ios.js | 26 +++++++++++++++---- 3 files changed, 48 insertions(+), 17 deletions(-) diff --git a/examples/ReactNativeBenchmarks/benchmarks.js b/examples/ReactNativeBenchmarks/benchmarks.js index 2327f26b..a0b3cb47 100644 --- a/examples/ReactNativeBenchmarks/benchmarks.js +++ b/examples/ReactNativeBenchmarks/benchmarks.js @@ -17,7 +17,8 @@ //////////////////////////////////////////////////////////////////////////// 'use strict'; -import React, { + +import { AppRegistry, Component, StyleSheet, @@ -27,9 +28,9 @@ import React, { TouchableHighlight } from 'react-native'; -const Store = require('react-native-store'); -const SQLite = require('react-native-sqlite-storage'); -const Realm = require('realm'); +import Store from 'react-native-store'; +import SQLite from 'react-native-sqlite-storage'; +import Realm from 'realm'; // Make SQLite module use Promises. SQLite.enablePromise(true); @@ -353,7 +354,7 @@ class RNSqliteTests extends Tests { const apiTests = [new RealmTests, new RNSqliteTests, new RNStoreTests]; -class ReactNativeBenchmarks extends Component { +export default class ReactNativeBenchmarks extends Component { constructor(props) { super(props); @@ -497,5 +498,3 @@ const styles = StyleSheet.create({ fontSize: 12 } }); - -module.exports = ReactNativeBenchmarks; diff --git a/examples/ReactNativeBenchmarks/index.android.js b/examples/ReactNativeBenchmarks/index.android.js index 1f41b179..7698986f 100644 --- a/examples/ReactNativeBenchmarks/index.android.js +++ b/examples/ReactNativeBenchmarks/index.android.js @@ -1,8 +1,24 @@ +//////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Realm Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////// + 'use strict'; -import React, { - AppRegistry -} from 'react-native'; -const ReactNativeBenchmarks = require('./benchmarks'); +import { AppRegistry } from 'react-native'; +import ReactNativeBenchmarks from './benchmarks'; -AppRegistry.registerComponent('ReactNativeBenchmarks', () => ReactNativeBenchmarks); \ No newline at end of file +AppRegistry.registerComponent('ReactNativeBenchmarks', () => ReactNativeBenchmarks); diff --git a/examples/ReactNativeBenchmarks/index.ios.js b/examples/ReactNativeBenchmarks/index.ios.js index 09daf219..7698986f 100644 --- a/examples/ReactNativeBenchmarks/index.ios.js +++ b/examples/ReactNativeBenchmarks/index.ios.js @@ -1,8 +1,24 @@ -'use strict'; -import React, { - AppRegistry -} from 'react-native'; +//////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Realm Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////// -const ReactNativeBenchmarks = require('./benchmarks'); +'use strict'; + +import { AppRegistry } from 'react-native'; +import ReactNativeBenchmarks from './benchmarks'; AppRegistry.registerComponent('ReactNativeBenchmarks', () => ReactNativeBenchmarks);