Skip to content

Commit

Permalink
Break runtime cycle between VirtualizedList and VirtualizedListContext
Browse files Browse the repository at this point in the history
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
  • Loading branch information
motiz88 authored and facebook-github-bot committed Oct 17, 2022
1 parent 9fb3700 commit 49cb7f2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Libraries/Lists/VirtualizedListContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
* @format
*/

import VirtualizedList from './VirtualizedList';
import typeof VirtualizedList from './VirtualizedList';

import * as React from 'react';
import {useContext, useMemo} from 'react';

Expand All @@ -25,13 +26,13 @@ type Context = $ReadOnly<{
zoomScale: number,
},
horizontal: ?boolean,
getOutermostParentListRef: () => React.ElementRef<typeof VirtualizedList>,
getOutermostParentListRef: () => React.ElementRef<VirtualizedList>,
registerAsNestedChild: ({
cellKey: string,
ref: React.ElementRef<typeof VirtualizedList>,
ref: React.ElementRef<VirtualizedList>,
}) => void,
unregisterAsNestedChild: ({
ref: React.ElementRef<typeof VirtualizedList>,
ref: React.ElementRef<VirtualizedList>,
}) => void,
}>;

Expand Down

0 comments on commit 49cb7f2

Please sign in to comment.