diff --git a/examples/ReactExample/components/todo-app.js b/examples/ReactExample/components/todo-app.js
index 0759bdb4..31e0d55a 100644
--- a/examples/ReactExample/components/todo-app.js
+++ b/examples/ReactExample/components/todo-app.js
@@ -18,10 +18,13 @@
'use strict';
-import React, {
+import React from 'react';
+
+import {
Component,
Navigator,
- StatusBarIOS,
+ Platform,
+ StatusBar,
Text,
TouchableOpacity,
View,
@@ -60,8 +63,8 @@ export default class TodoApp extends Component {
}
componentWillMount() {
- if (StatusBarIOS) {
- StatusBarIOS.setStyle('light-content');
+ if (Platform.OS == 'ios') {
+ StatusBar.setBarStyle('light-content');
}
}
diff --git a/examples/ReactExample/components/todo-item.js b/examples/ReactExample/components/todo-item.js
index 4f0d2b27..9e36f849 100644
--- a/examples/ReactExample/components/todo-item.js
+++ b/examples/ReactExample/components/todo-item.js
@@ -18,7 +18,9 @@
'use strict';
-import React, {
+import React from 'react';
+
+import {
Text,
TouchableWithoutFeedback,
View,
diff --git a/examples/ReactExample/components/todo-list-item.js b/examples/ReactExample/components/todo-list-item.js
index 38a879ef..b82b823f 100644
--- a/examples/ReactExample/components/todo-list-item.js
+++ b/examples/ReactExample/components/todo-list-item.js
@@ -18,7 +18,9 @@
'use strict';
-import React, {
+import React from 'react';
+
+import {
Platform,
Text,
TextInput,
diff --git a/examples/ReactExample/components/todo-listview.js b/examples/ReactExample/components/todo-listview.js
index f05a18ea..4f94612a 100644
--- a/examples/ReactExample/components/todo-listview.js
+++ b/examples/ReactExample/components/todo-listview.js
@@ -18,7 +18,9 @@
'use strict';
-import React, {
+import React from 'react';
+
+import {
Text,
View,
} from 'react-native';
diff --git a/examples/ReactExample/package.json b/examples/ReactExample/package.json
index e9bc01f5..ce59f399 100644
--- a/examples/ReactExample/package.json
+++ b/examples/ReactExample/package.json
@@ -6,8 +6,8 @@
"start": "react-native start"
},
"dependencies": {
- "react": "^0.14.5",
- "react-native": "^0.24.1",
+ "react": "^0.14.8",
+ "react-native": "^0.25.1",
"realm": "file:../.."
}
}
diff --git a/examples/ReactNativeBenchmarks/benchmarks.js b/examples/ReactNativeBenchmarks/benchmarks.js
index 2327f26b..ea8c2322 100644
--- a/examples/ReactNativeBenchmarks/benchmarks.js
+++ b/examples/ReactNativeBenchmarks/benchmarks.js
@@ -17,8 +17,10 @@
////////////////////////////////////////////////////////////////////////////
'use strict';
-import React, {
- AppRegistry,
+
+import React from 'react';
+
+import {
Component,
StyleSheet,
Text,
@@ -27,9 +29,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 +355,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 +499,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);
diff --git a/examples/ReactNativeBenchmarks/package.json b/examples/ReactNativeBenchmarks/package.json
index fde13094..823ee573 100644
--- a/examples/ReactNativeBenchmarks/package.json
+++ b/examples/ReactNativeBenchmarks/package.json
@@ -6,8 +6,8 @@
"start": "react-native start"
},
"dependencies": {
- "react": "^0.14.5",
- "react-native": "^0.24.1",
+ "react": "^0.14.8",
+ "react-native": "^0.25.1",
"react-native-sqlite-storage": "^2.1.3",
"react-native-store": "^0.4.1",
"realm": "file:../.."
diff --git a/react-native/index.js b/react-native/index.js
index d587e5cf..6789365a 100644
--- a/react-native/index.js
+++ b/react-native/index.js
@@ -18,4 +18,6 @@
'use strict';
-exports.ListView = require('./listview');
+import ListView from './listview';
+
+export { ListView };
diff --git a/react-native/listview.js b/react-native/listview.js
index ecbc4bb4..96d64c3a 100644
--- a/react-native/listview.js
+++ b/react-native/listview.js
@@ -18,7 +18,8 @@
'use strict';
-const React = require('react-native');
+import React from 'react';
+import { ListView as BaseListView } from 'react-native';
function hashObjects(array) {
let hash = Object.create(null);
@@ -28,7 +29,7 @@ function hashObjects(array) {
return hash;
}
-class ListViewDataSource extends React.ListView.DataSource {
+class ListViewDataSource extends BaseListView.DataSource {
cloneWithRowsAndSections(inputData, sectionIds, rowIds) {
let data = {};
@@ -160,7 +161,7 @@ class ListViewDataSource extends React.ListView.DataSource {
}
}
-class ListView extends React.Component {
+export default class ListView extends React.Component {
constructor(props) {
super(props);
@@ -169,7 +170,7 @@ class ListView extends React.Component {
render() {
return (
-
+
);
}
@@ -200,5 +201,3 @@ ListView.propTypes = {
};
ListView.DataSource = ListViewDataSource;
-
-module.exports = ListView;
diff --git a/tests/js/asserts.js b/tests/js/asserts.js
index 7031717b..fae31ea6 100644
--- a/tests/js/asserts.js
+++ b/tests/js/asserts.js
@@ -111,10 +111,12 @@ module.exports = {
},
isNode: function() {
+ // eslint-disable-next-line no-undef
return typeof process == 'object' && Object.prototype.toString.call(process) == '[object process]';
},
isNode6: function() {
+ // eslint-disable-next-line no-undef
return this.isNode() && process.version.indexOf('v6.') == 0;
},
};
diff --git a/tests/react-test-app/index.android.js b/tests/react-test-app/index.android.js
index 844cf78f..75bd0741 100644
--- a/tests/react-test-app/index.android.js
+++ b/tests/react-test-app/index.android.js
@@ -17,7 +17,7 @@
////////////////////////////////////////////////////////////////////////////
'use strict';
-const React = require('react-native');
+const React = require('react');
const Realm = require('realm');
const RealmTests = require('realm-tests');
const builder = require('xmlbuilder');
@@ -30,7 +30,7 @@ const {
Text,
View,
TouchableNativeFeedback,
-} = React;
+} = require('react-native');
RealmTests.registerTests({
ListViewTest: require('./tests/listview-test'),
diff --git a/tests/react-test-app/index.ios.js b/tests/react-test-app/index.ios.js
index 1164823c..cce02e5e 100644
--- a/tests/react-test-app/index.ios.js
+++ b/tests/react-test-app/index.ios.js
@@ -18,7 +18,7 @@
'use strict';
-const React = require('react-native');
+const React = require('react');
const Realm = require('realm');
const tests = require('./tests');
@@ -28,7 +28,7 @@ const {
Text,
TouchableHighlight,
View,
-} = React;
+} = require('react-native');
class ReactTests extends React.Component {
render() {
diff --git a/tests/react-test-app/package.json b/tests/react-test-app/package.json
index d746aa89..be90074d 100644
--- a/tests/react-test-app/package.json
+++ b/tests/react-test-app/package.json
@@ -6,8 +6,8 @@
"start": "react-native start"
},
"dependencies": {
- "react": "^0.14.5",
- "react-native": "^0.24.1",
+ "react": "^0.14.8",
+ "react-native": "^0.25.1",
"react-native-fs": "^1.1.0",
"xmlbuilder": "^4.2.1",
"realm": "file:../..",