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 (facebook@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 OlimpiaZurek committed May 22, 2023
1 parent 094ae08 commit 6793c59
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 6793c59

Please sign in to comment.