Skip to content

Commit cb66c4e

Browse files
committed
Fix import issues
1 parent 14d468b commit cb66c4e

File tree

3 files changed

+18
-20
lines changed

3 files changed

+18
-20
lines changed

js/ProgressViewIOS.android.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99

1010
'use strict';
1111

12-
const React = require('React');
13-
const StyleSheet = require('StyleSheet');
14-
const Text = require('Text');
15-
const View = require('View');
12+
import * as React from 'react';
13+
import {Text, View, StyleSheet} from 'react-native';
1614

1715
class DummyProgressViewIOS extends React.Component {
1816
render() {
@@ -43,4 +41,4 @@ const styles = StyleSheet.create({
4341
},
4442
});
4543

46-
module.exports = DummyProgressViewIOS;
44+
export default DummyProgressViewIOS;

js/ProgressViewIOS.ios.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
'use strict';
1212

13-
const React = require('React');
14-
const StyleSheet = require('StyleSheet');
13+
import * as React from 'react';
14+
import {StyleSheet, ColorValue} from 'react-native';
1515

16-
const RNCProgressViewNativeComponent = require('RNCProgressViewNativeComponent');
16+
import RNCProgressViewNativeComponent from 'RNCProgressViewNativeComponent';
1717

18-
import type {ImageSource} from 'ImageSource';
19-
import type {ColorValue} from 'StyleSheetTypes';
20-
import type {ViewProps} from 'ViewPropTypes';
18+
import type {ImageSource} from 'react-native/Libraries/Image/ImageSource';
19+
import type {ColorValue} from 'react-native/Libraries/StyleSheet/StyleSheetTypes';
20+
import type {ViewProps} from 'react-native/Libraries/Components/View/ViewPropTypes';
2121

2222
type Props = $ReadOnly<{|
2323
...ViewProps,
@@ -73,9 +73,9 @@ const styles = StyleSheet.create({
7373
},
7474
});
7575

76-
const ProgressViewIOSWithRef = React.forwardRef(ProgressViewIOS);
76+
const ProgressViewIOSWithRef = forwardRef(ProgressViewIOS);
7777

7878
/* $FlowFixMe(>=0.89.0 site=react_native_ios_fb) This comment suppresses an
7979
* error found when Flow v0.89 was deployed. To see the error, delete this
8080
* comment and run Flow. */
81-
module.exports = (ProgressViewIOSWithRef: RNCProgressViewNativeComponent);
81+
export default (ProgressViewIOSWithRef: RNCProgressViewNativeComponent);

js/RNCProgressViewNativeComponent.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
'use strict';
1212

13-
const requireNativeComponent = require('requireNativeComponent');
13+
import {requireNativeComponent} from 'react-native';
1414

15-
import type {NativeComponent} from 'ReactNative';
16-
import type {ImageSource} from 'ImageSource';
17-
import type {ColorValue} from 'StyleSheetTypes';
18-
import type {ViewProps} from 'ViewPropTypes';
15+
import type {NativeComponent} from 'react-native/Libraries/Renderer/shims/ReactNative';
16+
import type {ImageSource} from 'react-native/Libraries/Image/ImageSource';
17+
import type {ColorValue} from 'react-native/Libraries/StyleSheet/StyleSheetTypes';
18+
import type {ViewProps} from 'react-native/Libraries/Components/View/ViewPropTypes';
1919

2020
type NativeProps = $ReadOnly<{|
2121
...ViewProps,
@@ -29,6 +29,6 @@ type NativeProps = $ReadOnly<{|
2929

3030
type NativeProgressViewIOS = Class<NativeComponent<NativeProps>>;
3131

32-
module.exports = ((requireNativeComponent(
32+
export default ((requireNativeComponent(
3333
'RNCProgressView',
34-
): any): NativeProgressViewIOS);
34+
): any): NativeProgressViewIOS);

0 commit comments

Comments
 (0)