Skip to content

Commit daa6f42

Browse files
committed
Change imports to ES6 and import correct ProgressViewIOS
1 parent 74669ce commit daa6f42

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

example/index.js

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,23 @@
88
* @flow
99
*/
1010

11-
"use strict";
11+
'use strict';
1212

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';
1817

1918
type Props = {||};
2019
type State = {|
21-
progress: number
20+
progress: number,
2221
|};
2322

2423
class ProgressViewExample extends React.Component<Props, State> {
2524
_rafId: ?AnimationFrameID = null;
2625

2726
state = {
28-
progress: 0
27+
progress: 0,
2928
};
3029

3130
componentDidMount() {
@@ -40,7 +39,7 @@ class ProgressViewExample extends React.Component<Props, State> {
4039

4140
updateProgress = () => {
4241
const progress = this.state.progress + 0.01;
43-
this.setState({ progress });
42+
this.setState({progress});
4443
this._rafId = requestAnimationFrame(() => this.updateProgress());
4544
};
4645

@@ -87,24 +86,24 @@ class ProgressViewExample extends React.Component<Props, State> {
8786
const styles = StyleSheet.create({
8887
container: {
8988
marginTop: -20,
90-
backgroundColor: "transparent"
89+
backgroundColor: 'transparent',
9190
},
9291
progressView: {
93-
marginTop: 20
94-
}
92+
marginTop: 20,
93+
},
9594
});
9695

9796
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';
101100
exports.examples = [
102101
{
103-
title: "ProgressViewIOS",
102+
title: 'ProgressViewIOS',
104103
render() {
105104
return <ProgressViewExample />;
106-
}
107-
}
105+
},
106+
},
108107
];
109108

110109
AppRegistry.registerComponent(appName, () => ProgressViewExample);

0 commit comments

Comments
 (0)