Skip to content

Commit 23c8787

Browse files
SamChou19815facebook-github-bot
authored andcommitted
Add annotations to fix future errors after fix for unsound array types (#52691)
Summary: Pull Request resolved: #52691 Unannotated array literals are unsound in Flow right now. This diff adds in annotations and makes a few things readonly, to reduce future errors. Changelog: [Internal] Reviewed By: marcoww6 Differential Revision: D78519638 fbshipit-source-id: d98a7668ecf97bcc87dcb3fad25ade736d885d9a
1 parent d78c242 commit 23c8787

File tree

60 files changed

+163
-62
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+163
-62
lines changed

packages/rn-tester/js/examples/Accessibility/AccessibilityAndroidExample.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
'use strict';
1212

13+
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
14+
1315
import RNTesterBlock from '../../components/RNTesterBlock';
1416
import RNTesterPage from '../../components/RNTesterPage';
1517
import RNTesterText from '../../components/RNTesterText';
@@ -282,4 +284,4 @@ exports.examples = [
282284
return <AccessibilityAndroidExample />;
283285
},
284286
},
285-
];
287+
] as Array<RNTesterModuleExample>;

packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
'use strict';
1212

13+
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
1314
import type {EventSubscription, GestureResponderEvent} from 'react-native';
1415

1516
import RNTesterBlock from '../../components/RNTesterBlock';
@@ -2250,4 +2251,4 @@ exports.examples = [
22502251
return <LabelCooptingExample />;
22512252
},
22522253
},
2253-
];
2254+
] as Array<RNTesterModuleExample>;

packages/rn-tester/js/examples/Accessibility/AccessibilityIOSExample.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
'use strict';
1212

13+
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
14+
1315
const {RNTesterThemeContext} = require('../../components/RNTesterTheme');
1416
const React = require('react');
1517
const {Alert, Text, View} = require('react-native');
@@ -83,4 +85,4 @@ exports.examples = [
8385
return <AccessibilityIOSExample />;
8486
},
8587
},
86-
];
88+
] as Array<RNTesterModuleExample>;

packages/rn-tester/js/examples/ActionSheetIOS/ActionSheetIOSExample.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
'use strict';
1212

13+
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
1314
import type {HostInstance} from 'react-native';
1415

1516
import {RNTesterThemeContext} from '../../components/RNTesterTheme';
@@ -573,4 +574,4 @@ exports.examples = [
573574
return <ShareScreenshotAnchorExample />;
574575
},
575576
},
576-
];
577+
] as Array<RNTesterModuleExample>;

packages/rn-tester/js/examples/AnimatedGratuitousApp/AnExApp.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
'use strict';
1212

13+
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
14+
1315
import AnExSet from './AnExSet';
1416
import React from 'react';
1517
import {
@@ -396,4 +398,4 @@ exports.examples = [
396398
return <AnExApp />;
397399
},
398400
},
399-
];
401+
] as Array<RNTesterModuleExample>;

packages/rn-tester/js/examples/Appearance/AppearanceExample.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @format
99
*/
1010

11+
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
1112
import type {ColorSchemeName} from 'react-native';
1213

1314
import RNTesterText from '../../components/RNTesterText';
@@ -245,4 +246,4 @@ exports.examples = [
245246
return <ToggleNativeAppearance />;
246247
},
247248
},
248-
];
249+
] as Array<RNTesterModuleExample>;

packages/rn-tester/js/examples/BoxShadow/BoxShadowExample.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* @format
99
*/
1010

11+
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
12+
1113
import * as React from 'react';
1214
import {Image, StyleSheet, View} from 'react-native';
1315

@@ -191,4 +193,4 @@ exports.examples = [
191193
);
192194
},
193195
},
194-
];
196+
] as Array<RNTesterModuleExample>;

packages/rn-tester/js/examples/Button/ButtonExample.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
'use strict';
1212

13+
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
14+
1315
const {RNTesterThemeContext} = require('../../components/RNTesterTheme');
1416
const React = require('react');
1517
const {Alert, Button, StyleSheet, View} = require('react-native');
@@ -221,7 +223,7 @@ exports.examples = [
221223
);
222224
},
223225
},
224-
];
226+
] as Array<RNTesterModuleExample>;
225227

226228
const styles = StyleSheet.create({
227229
container: {

packages/rn-tester/js/examples/ContentURLAndroid/ContentURLAndroid.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
'use strict';
1212

13+
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
14+
1315
import RNTesterBlock from '../../components/RNTesterBlock';
1416
import RNTesterPage from '../../components/RNTesterPage';
1517
import RNTesterText from '../../components/RNTesterText';
@@ -116,4 +118,4 @@ exports.examples = [
116118
return <ContentURLAndroidExample />;
117119
},
118120
},
119-
];
121+
] as Array<RNTesterModuleExample>;

packages/rn-tester/js/examples/Crash/CrashExample.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @format
99
*/
1010

11+
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
1112
import type {Node} from 'react';
1213

1314
import React from 'react';
@@ -37,4 +38,4 @@ exports.examples = [
3738
);
3839
},
3940
},
40-
];
41+
] as Array<RNTesterModuleExample>;

0 commit comments

Comments
 (0)