Skip to content

Commit 49cb7f2

Browse files
motiz88facebook-github-bot
authored andcommitted
Break runtime cycle between VirtualizedList and VirtualizedListContext
Summary: Breaks the runtime dependency cycle introduced in D40259791 (9715993) by converting a value import to a type import. (Unlike runtime dependency cycles, type-level cycles are OK as long as they are reasonably small.) Changelog: [General][Fixed] - Fix require cycle warning in VirtualizedList Reviewed By: javache Differential Revision: D40412019 fbshipit-source-id: 33bf3af12be64a1932549a0d11f2ce8b3c483218
1 parent 9fb3700 commit 49cb7f2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Libraries/Lists/VirtualizedListContext.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
* @format
99
*/
1010

11-
import VirtualizedList from './VirtualizedList';
11+
import typeof VirtualizedList from './VirtualizedList';
12+
1213
import * as React from 'react';
1314
import {useContext, useMemo} from 'react';
1415

@@ -25,13 +26,13 @@ type Context = $ReadOnly<{
2526
zoomScale: number,
2627
},
2728
horizontal: ?boolean,
28-
getOutermostParentListRef: () => React.ElementRef<typeof VirtualizedList>,
29+
getOutermostParentListRef: () => React.ElementRef<VirtualizedList>,
2930
registerAsNestedChild: ({
3031
cellKey: string,
31-
ref: React.ElementRef<typeof VirtualizedList>,
32+
ref: React.ElementRef<VirtualizedList>,
3233
}) => void,
3334
unregisterAsNestedChild: ({
34-
ref: React.ElementRef<typeof VirtualizedList>,
35+
ref: React.ElementRef<VirtualizedList>,
3536
}) => void,
3637
}>;
3738

0 commit comments

Comments
 (0)