Skip to content

Commit b53aaee

Browse files
committed
Updated simple example
1 parent 981e441 commit b53aaee

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

examples/Simple/index.android.js

+11-7
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@
44
*/
55
'use strict';
66

7-
var React = require('react-native');
8-
var {
7+
import React, { Component } from 'react';
8+
9+
import {
910
AppRegistry,
1011
StyleSheet,
1112
Text,
12-
View,
13-
} = React;
13+
View
14+
} from 'react-native';
15+
16+
// TODO: Update Android example
1417

15-
var Simple = React.createClass({
16-
render: function() {
18+
class Simple extends Component {
19+
render() {
1720
return (
1821
<View>
1922
<Text>
@@ -22,6 +25,7 @@ var Simple = React.createClass({
2225
</View>
2326
);
2427
}
25-
});
28+
29+
}
2630

2731
AppRegistry.registerComponent('Simple', () => Simple);

examples/Simple/index.ios.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@
22
* Sample React Native App showing use of AwesomeButton
33
*/
44

5+
'use strict';
56

6-
const React = require('react-native')
7-
const AwesomeButton = require('react-native-awesome-button')
7+
import React, { Component } from 'react';
88

9-
10-
const {
9+
import {
1110
AppRegistry,
1211
Component,
1312
View,
1413
StyleSheet
15-
} = React
16-
14+
} from 'react-native';
1715

1816
const styles = StyleSheet.create({
1917
container: {
@@ -25,7 +23,6 @@ const styles = StyleSheet.create({
2523
}
2624
})
2725

28-
2926
class Simple extends Component {
3027

3128
handleButtonPress() {
@@ -48,4 +45,4 @@ class Simple extends Component {
4845
}
4946

5047

51-
AppRegistry.registerComponent('Simple', () => Simple)
48+
AppRegistry.registerComponent('Simple', () => Simple)

0 commit comments

Comments
 (0)