mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix VirtualizeSectionList generic arguments (#51496)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51496 Fixes problem with generics passed to `VirtualizedSectionList` in generated types. The `flow-api-translator` creates a re-declaration for `export default` variables which shadows generics. Changelog: [Internal] Reviewed By: huntie Differential Revision: D75141051 fbshipit-source-id: 260ef066038320eee3ffa93692f77f1eff5c9205
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f900551216
commit
44b0f5560b
@@ -611,7 +611,7 @@ function ItemWithSeparator<ItemT>(
|
||||
);
|
||||
}
|
||||
|
||||
export default VirtualizedSectionList as component<
|
||||
const VirtualizedSectionListComponent = VirtualizedSectionList as component<
|
||||
ItemT,
|
||||
SectionT: SectionBase<ItemT, DefaultSectionT> = DefaultSectionT,
|
||||
>(
|
||||
@@ -623,3 +623,10 @@ export default VirtualizedSectionList as component<
|
||||
>,
|
||||
...VirtualizedSectionListProps<ItemT, SectionT>
|
||||
);
|
||||
|
||||
export default VirtualizedSectionListComponent;
|
||||
|
||||
export type AnyVirtualizedSectionList = typeof VirtualizedSectionListComponent<
|
||||
any,
|
||||
any,
|
||||
>;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import typeof FillRateHelper from './Lists/FillRateHelper';
|
||||
import typeof ViewabilityHelper from './Lists/ViewabilityHelper';
|
||||
import typeof VirtualizedList from './Lists/VirtualizedList';
|
||||
import typeof VirtualizedSectionList from './Lists/VirtualizedSectionList';
|
||||
import type {AnyVirtualizedSectionList} from './Lists/VirtualizedSectionList';
|
||||
|
||||
import {typeof VirtualizedListContextResetter} from './Lists/VirtualizedListContext';
|
||||
import {keyExtractor} from './Lists/VirtualizeUtils';
|
||||
@@ -45,7 +45,7 @@ export default {
|
||||
get VirtualizedList(): VirtualizedList {
|
||||
return require('./Lists/VirtualizedList').default;
|
||||
},
|
||||
get VirtualizedSectionList(): VirtualizedSectionList<any, any> {
|
||||
get VirtualizedSectionList(): AnyVirtualizedSectionList {
|
||||
return require('./Lists/VirtualizedSectionList').default;
|
||||
},
|
||||
get VirtualizedListContextResetter(): VirtualizedListContextResetter {
|
||||
|
||||
Reference in New Issue
Block a user