Skip to content

Commit 5457339

Browse files
authored
chore: update example to RN 0.63 (#36)
1 parent f4a9cdd commit 5457339

30 files changed

+1736
-1874
lines changed

.flowconfig

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,56 +2,52 @@
22
; We fork some components by platform
33
.*/*[.]android.js
44

5-
; Ignore "BUCK" generated dirs
6-
<PROJECT_ROOT>/\.buckd/
7-
8-
; Ignore polyfills
9-
node_modules/react-native/Libraries/polyfills/.*
10-
115
; These should not be required directly
126
; require from fbjs/lib instead: require('fbjs/lib/warning')
13-
node_modules/warning/.*
7+
.*/node_modules/warning/.*
148

159
; Flow doesn't support platforms
1610
.*/Libraries/Utilities/LoadingView.js
1711

18-
; Ignore example folder
19-
.*/example/.*
20-
21-
2212
[untyped]
2313
.*/node_modules/@react-native-community/cli/.*/.*
2414

2515
[include]
2616

17+
[declarations]
18+
.*/node_modules/.*
19+
2720
[libs]
28-
node_modules/react-native/Libraries/react-native/react-native-interface.js
29-
node_modules/react-native/flow/
21+
interface.js
22+
flow/
3023

3124
[options]
3225
emoji=true
3326

3427
esproposal.optional_chaining=enable
3528
esproposal.nullish_coalescing=enable
3629

30+
exact_by_default=true
31+
3732
module.file_ext=.js
3833
module.file_ext=.json
3934
module.file_ext=.ios.js
4035

4136
munge_underscores=true
4237

4338
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation'
44-
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
39+
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
4540
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
4641

4742
suppress_type=$FlowIssue
4843
suppress_type=$FlowFixMe
4944
suppress_type=$FlowFixMeProps
5045
suppress_type=$FlowFixMeState
46+
suppress_type=$FlowFixMeEmpty
5147

52-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
53-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
54-
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
48+
experimental.well_formed_exports=true
49+
experimental.types_first=true
50+
experimental.abstract_locations=true
5551

5652
[lints]
5753
sketchy-null-number=warn
@@ -61,10 +57,10 @@ untyped-type-import=warn
6157
nonstrict-import=warn
6258
deprecated-type=warn
6359
unsafe-getters-setters=warn
64-
inexact-spread=warn
6560
unnecessary-invariant=warn
6661
signature-verification-failure=warn
6762
deprecated-utility=error
63+
unsafe-addition=error
6864

6965
[strict]
7066
deprecated-type
@@ -76,4 +72,4 @@ untyped-import
7672
untyped-type-import
7773

7874
[version]
79-
^0.105.0
75+
^0.127.0

.gitattributes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
*.pbxproj -text
1+
*.pbxproj -text
2+
# specific for windows script files
3+
*.bat text eol=crlf

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ DerivedData
2929
*.ipa
3030
*.xcuserstate
3131
project.xcworkspace
32+
*/ios/Pods
3233

3334

3435
# Android/IntelliJ
@@ -38,8 +39,12 @@ build/
3839
.gradle
3940
local.properties
4041
*.iml
42+
.project
43+
.settings
44+
.classpath
4145

4246
# BUCK
4347
buck-out/
4448
\.buckd/
45-
*.keystore
49+
!debug.keystore
50+
*.keystore

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"flow.useNPMPackagedFlow": true,
3+
"javascript.validate.enable": false
4+
}

example/.flowconfig

Lines changed: 0 additions & 69 deletions
This file was deleted.
Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
1-
/**
2-
* Copyright (c) Facebook, Inc. and its affiliates.
3-
*
4-
* This source code is licensed under the MIT license found in the
5-
* LICENSE file in the root directory of this source tree.
6-
*
7-
* @flow
8-
*/
9-
10-
'use strict';
11-
12-
import {name as appName} from './app.json';
131
import * as React from 'react';
14-
import {AppRegistry, StyleSheet, View} from 'react-native';
15-
import ProgressViewIOS from '@react-native-community/progress-view';
2+
import {StyleSheet, Text, SafeAreaView} from 'react-native';
3+
import {ProgressView} from '../js';
164

175
type Props = {||};
186
type State = {|
197
progress: number,
208
|};
219

22-
class ProgressViewExample extends React.Component<Props, State> {
10+
export class App extends React.Component<Props, State> {
2311
_rafId: ?AnimationFrameID = null;
2412

2513
state = {
@@ -52,57 +40,47 @@ class ProgressViewExample extends React.Component<Props, State> {
5240

5341
render() {
5442
return (
55-
<View style={styles.container}>
56-
<ProgressViewIOS
43+
<SafeAreaView style={styles.container}>
44+
<Text style={styles.header}>ProgressView Example</Text>
45+
<ProgressView
5746
style={styles.progressView}
5847
progress={this.getProgress(0)}
5948
/>
60-
<ProgressViewIOS
49+
<ProgressView
6150
style={styles.progressView}
6251
progressTintColor="purple"
6352
progress={this.getProgress(0.2)}
6453
/>
65-
<ProgressViewIOS
54+
<ProgressView
6655
style={styles.progressView}
6756
progressTintColor="red"
6857
progress={this.getProgress(0.4)}
6958
/>
70-
<ProgressViewIOS
59+
<ProgressView
7160
style={styles.progressView}
7261
progressTintColor="orange"
7362
progress={this.getProgress(0.6)}
7463
/>
75-
<ProgressViewIOS
64+
<ProgressView
7665
style={styles.progressView}
7766
progressTintColor="yellow"
7867
progress={this.getProgress(0.8)}
7968
/>
80-
</View>
69+
</SafeAreaView>
8170
);
8271
}
8372
}
8473

8574
const styles = StyleSheet.create({
8675
container: {
87-
marginTop: -20,
76+
flex: 1,
8877
backgroundColor: 'transparent',
8978
},
9079
progressView: {
9180
marginTop: 20,
9281
},
93-
});
94-
95-
exports.displayName = (undefined: ?string);
96-
exports.framework = 'React';
97-
exports.title = 'ProgressViewIOS';
98-
exports.description = 'ProgressViewIOS';
99-
exports.examples = [
100-
{
101-
title: 'ProgressViewIOS',
102-
render() {
103-
return <ProgressViewExample />;
104-
},
82+
header: {
83+
fontSize: 24,
84+
fontWeight: '700',
10585
},
106-
];
107-
108-
AppRegistry.registerComponent(appName, () => ProgressViewExample);
86+
});

0 commit comments

Comments
 (0)