Skip to content

Commit d0a6bae

Browse files
SamChou19815meta-codesync[bot]
authored andcommitted
Pre-suppress newly detected variance errors in declare class in xplat (#54620)
Summary: Pull Request resolved: #54620 Changelog: [Internal] Reviewed By: marcoww6 Differential Revision: D87550655 fbshipit-source-id: c169abb845de33207eb6e32d43ab146f5c45d9b1
1 parent 52a4f4b commit d0a6bae

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

packages/react-native/flow/dom.js.flow

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,7 @@ declare class HTMLCollection<+Elem: HTMLElement> {
13841384
length: number;
13851385
item(nameOrIndex?: any, optionalIndex?: any): Elem | null;
13861386
namedItem(name: string): Elem | null;
1387+
// $FlowFixMe[incompatible-variance]
13871388
[index: number | string]: Elem;
13881389
}
13891390

packages/react-native/src/private/webapis/dom/oldstylecollections/HTMLCollection.js.flow

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
import type {ArrayLike} from '../../utils/ArrayLikeUtils';
1212

1313
declare export default class HTMLCollection<+T>
14+
// $FlowFixMe[incompatible-variance]
1415
implements Iterable<T>, ArrayLike<T>
1516
{
1617
// This property should've been read-only as well, but Flow doesn't handle
1718
// read-only indexers correctly (thinks reads are writes and fails).
19+
// $FlowFixMe[incompatible-variance]
1820
[index: number]: T;
1921
+length: number;
2022
item(index: number): T | null;

packages/react-native/src/private/webapis/dom/oldstylecollections/NodeList.js.flow

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

1111
import type {ArrayLike} from '../../utils/ArrayLikeUtils';
1212

13+
// $FlowFixMe[incompatible-variance]
1314
declare export default class NodeList<+T> implements Iterable<T>, ArrayLike<T> {
1415
// This property should've been read-only as well, but Flow doesn't handle
1516
// read-only indexers correctly (thinks reads are writes and fails).
17+
// $FlowFixMe[incompatible-variance]
1618
[index: number]: T;
1719
+length: number;
1820
item(index: number): T | null;
21+
// $FlowFixMe[incompatible-variance]
1922
entries(): Iterator<[number, T]>;
2023
forEach<ThisType>(
2124
callbackFn: (value: T, index: number, array: NodeList<T>) => mixed,

0 commit comments

Comments
 (0)