mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
Merge pull request #28392 from danilobuerger/patch-4
[react-native] SectionList is a VirtualizedList
This commit is contained in:
10
types/react-native/index.d.ts
vendored
10
types/react-native/index.d.ts
vendored
@@ -4042,7 +4042,7 @@ export interface SectionListRenderItemInfo<ItemT> extends ListRenderItemInfo<Ite
|
||||
|
||||
export type SectionListRenderItem<ItemT> = (info: SectionListRenderItemInfo<ItemT>) => React.ReactElement<any> | null;
|
||||
|
||||
export interface SectionListProps<ItemT> extends ScrollViewProps {
|
||||
export interface SectionListProps<ItemT> extends VirtualizedListWithoutRenderItemProps<ItemT> {
|
||||
/**
|
||||
* Rendered in between adjacent Items within each section.
|
||||
*/
|
||||
@@ -4201,7 +4201,11 @@ export interface SectionListStatic<SectionT> extends React.ComponentClass<Sectio
|
||||
/**
|
||||
* @see https://facebook.github.io/react-native/docs/virtualizedlist.html#props
|
||||
*/
|
||||
export interface VirtualizedListProps<ItemT> extends ScrollViewProps {
|
||||
export interface VirtualizedListProps<ItemT> extends VirtualizedListWithoutRenderItemProps<ItemT> {
|
||||
renderItem: ListRenderItem<ItemT>;
|
||||
}
|
||||
|
||||
export interface VirtualizedListWithoutRenderItemProps<ItemT> extends ScrollViewProps {
|
||||
/**
|
||||
* Rendered when the list is empty. Can be a React Component Class, a render function, or
|
||||
* a rendered element.
|
||||
@@ -4345,8 +4349,6 @@ export interface VirtualizedListProps<ItemT> extends ScrollViewProps {
|
||||
*/
|
||||
removeClippedSubviews?: boolean;
|
||||
|
||||
renderItem: ListRenderItem<ItemT>;
|
||||
|
||||
/**
|
||||
* Render a custom scroll component, e.g. with a differently styled `RefreshControl`.
|
||||
*/
|
||||
|
||||
@@ -360,6 +360,7 @@ export class SectionListTest extends React.Component<SectionListProps<string>, {
|
||||
<Text>{`${info.section.title} - ${info.item}`}</Text>
|
||||
</View>
|
||||
)}
|
||||
maxToRenderPerBatch={5}
|
||||
/>
|
||||
</React.Fragment>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user