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