File tree 2 files changed +16
-15
lines changed
2 files changed +16
-15
lines changed Original file line number Diff line number Diff line change 4
4
*/
5
5
'use strict' ;
6
6
7
- var React = require ( 'react-native' ) ;
8
- var {
7
+ import React , { Component } from 'react' ;
8
+
9
+ import {
9
10
AppRegistry ,
10
11
StyleSheet ,
11
12
Text ,
12
- View,
13
- } = React ;
13
+ View
14
+ } from 'react-native' ;
15
+
16
+ // TODO: Update Android example
14
17
15
- var Simple = React . createClass ( {
16
- render : function ( ) {
18
+ class Simple extends Component {
19
+ render ( ) {
17
20
return (
18
21
< View >
19
22
< Text >
@@ -22,6 +25,7 @@ var Simple = React.createClass({
22
25
</ View >
23
26
) ;
24
27
}
25
- } ) ;
28
+
29
+ }
26
30
27
31
AppRegistry . registerComponent ( 'Simple' , ( ) => Simple ) ;
Original file line number Diff line number Diff line change 2
2
* Sample React Native App showing use of AwesomeButton
3
3
*/
4
4
5
+ 'use strict' ;
5
6
6
- const React = require ( 'react-native' )
7
- const AwesomeButton = require ( 'react-native-awesome-button' )
7
+ import React , { Component } from 'react' ;
8
8
9
-
10
- const {
9
+ import {
11
10
AppRegistry ,
12
11
Component ,
13
12
View ,
14
13
StyleSheet
15
- } = React
16
-
14
+ } from 'react-native' ;
17
15
18
16
const styles = StyleSheet . create ( {
19
17
container : {
@@ -25,7 +23,6 @@ const styles = StyleSheet.create({
25
23
}
26
24
} )
27
25
28
-
29
26
class Simple extends Component {
30
27
31
28
handleButtonPress ( ) {
@@ -48,4 +45,4 @@ class Simple extends Component {
48
45
}
49
46
50
47
51
- AppRegistry . registerComponent ( 'Simple' , ( ) => Simple )
48
+ AppRegistry . registerComponent ( 'Simple' , ( ) => Simple )
You can’t perform that action at this time.
0 commit comments