Skip to content

Commit 78f298c

Browse files
committed
fix(types): comply with Flow linter
1 parent 0979697 commit 78f298c

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/react-native/Libraries/Utilities/__tests__/DeviceInfo-itest.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ describe('DeviceInfo', () => {
1515

1616
it('should give device info', () => {
1717
expect(DeviceInfo.getConstants().Dimensions).toBeDefined();
18-
expect(DeviceInfo.getInfo().Dimensions).toBeDefined();
1918
});
2019
});

packages/rn-tester/IntegrationTests/IntegrationTestsApp.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ const TESTS = [
3232
require('./WebSocketTest'),
3333
require('./AccessibilityManagerTest'),
3434
require('./GlobalEvalWithSourceUrlTest'),
35-
].map(mod => mod.default);
35+
// $FlowFixMe[incompatible-type] (>=0.319.0) `require()` modules have unknown shape
36+
].map(mod => mod.default) as Array<React.ComponentType<any>>;
3637

3738
TESTS.forEach(test =>
3839
AppRegistry.registerComponent(
39-
(test as React.ComponentType<any>).displayName || test.name || '',
40+
test.displayName || test.name || '',
4041
/* $FlowFixMe[incompatible-type] (>=0.54.0 site=react_native_fb,react_native_
4142
* oss) This comment suppresses an error found when Flow v0.54 was deployed.
4243
* To see the error delete this comment and run Flow. */
@@ -84,7 +85,7 @@ class IntegrationTestsApp extends React.Component<{...}, $FlowFixMe> {
8485
*/
8586
style={styles.row}>
8687
<Text style={styles.testName}>
87-
{(test as React.ComponentType<any>).displayName || test.name}
88+
{test.displayName || test.name}
8889
</Text>
8990
</TouchableOpacity>,
9091
<View style={styles.separator} />,

0 commit comments

Comments
 (0)