8
8
* @flow
9
9
*/
10
10
11
- ' use strict' ;
11
+ " use strict" ;
12
12
13
- const React = require ( 'react' ) ;
14
- const ReactNative = require ( 'react-native' ) ;
15
- const { ProgressViewIOS, StyleSheet, View} = ReactNative ;
13
+ import { name as appName } from "./app.json" ;
14
+
15
+ const React = require ( "react" ) ;
16
+ const ReactNative = require ( "react-native" ) ;
17
+ const { AppRegistry, ProgressViewIOS, StyleSheet, View } = ReactNative ;
16
18
17
19
type Props = { || } ;
18
20
type State = { |
19
- progress : number ,
21
+ progress : number
20
22
| } ;
21
23
22
24
class ProgressViewExample extends React . Component < Props , State > {
23
25
_rafId : ?AnimationFrameID = null ;
24
26
25
27
state = {
26
- progress : 0 ,
28
+ progress : 0
27
29
} ;
28
30
29
31
componentDidMount ( ) {
@@ -38,7 +40,7 @@ class ProgressViewExample extends React.Component<Props, State> {
38
40
39
41
updateProgress = ( ) => {
40
42
const progress = this . state . progress + 0.01 ;
41
- this . setState ( { progress} ) ;
43
+ this . setState ( { progress } ) ;
42
44
this . _rafId = requestAnimationFrame ( ( ) => this . updateProgress ( ) ) ;
43
45
} ;
44
46
@@ -85,22 +87,24 @@ class ProgressViewExample extends React.Component<Props, State> {
85
87
const styles = StyleSheet . create ( {
86
88
container : {
87
89
marginTop : - 20 ,
88
- backgroundColor : ' transparent' ,
90
+ backgroundColor : " transparent"
89
91
} ,
90
92
progressView : {
91
- marginTop : 20 ,
92
- } ,
93
+ marginTop : 20
94
+ }
93
95
} ) ;
94
96
95
97
exports . displayName = ( undefined : ?string ) ;
96
- exports . framework = ' React' ;
97
- exports . title = ' ProgressViewIOS' ;
98
- exports . description = ' ProgressViewIOS' ;
98
+ exports . framework = " React" ;
99
+ exports . title = " ProgressViewIOS" ;
100
+ exports . description = " ProgressViewIOS" ;
99
101
exports . examples = [
100
102
{
101
- title : ' ProgressViewIOS' ,
103
+ title : " ProgressViewIOS" ,
102
104
render ( ) {
103
105
return < ProgressViewExample /> ;
104
- } ,
105
- } ,
106
+ }
107
+ }
106
108
] ;
109
+
110
+ AppRegistry . registerComponent ( appName , ( ) => ProgressViewExample ) ;
0 commit comments