native-x-list
Advanced tools
Comparing version 1.1.0 to 1.2.0
import { ContainerStyleProps } from 'native-x-theme'; | ||
import { ReactElement, ReactNode } from 'react'; | ||
import { NativeScrollEvent, NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native'; | ||
import React, { ReactElement, ReactNode } from 'react'; | ||
import { FlatList, NativeScrollEvent, NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native'; | ||
export declare type ListRendererFn<S> = (item: S, index?: number) => ReactElement | null; | ||
@@ -41,2 +41,2 @@ export interface ListProps<S> extends ContainerStyleProps { | ||
} | ||
export declare function List<S>({ items, children, separator, keyExtractor, divider, horizontal, inverted, groupBy, searchBy, searchText, style, onSelectItem, error, emptyMessage, loading, isRefreshing, onRefresh, onFetchNext, numColumns, fill, disabled, onScrollToTopChange, showScrollIndicator, columnWrapperStyle, onScroll, stickySectionHeadersEnabled, maintainVisibleContent, ...props }: ListProps<S>): JSX.Element; | ||
export declare const List: React.ForwardRefExoticComponent<ListProps<unknown> & React.RefAttributes<FlatList<unknown>>>; |
@@ -11,2 +11,3 @@ /* eslint-disable react-hooks/exhaustive-deps */ | ||
import { styles as s } from 'tachyons-react-native'; | ||
import { useCombinedRefs } from './utils'; | ||
const ON_END_REACHED_THRESHOLD = 0.5; | ||
@@ -75,5 +76,5 @@ const SCROLL_EVENT_THROTTLE = 16; | ||
} | ||
export function List({ items, children, separator, keyExtractor, divider, horizontal, inverted, groupBy, searchBy, searchText, style, onSelectItem, error, emptyMessage, loading, isRefreshing = false, onRefresh, onFetchNext, numColumns, fill = false, disabled = false, onScrollToTopChange, showScrollIndicator = true, columnWrapperStyle, onScroll, stickySectionHeadersEnabled = true, maintainVisibleContent, ...props }) { | ||
function ListComponent({ items, children, separator, keyExtractor, divider, horizontal, inverted, groupBy, searchBy, searchText, style, onSelectItem, error, emptyMessage, loading, isRefreshing = false, onRefresh, onFetchNext, numColumns, fill = false, disabled = false, onScrollToTopChange, showScrollIndicator = true, columnWrapperStyle, onScroll, stickySectionHeadersEnabled = true, maintainVisibleContent, ...props }, ref) { | ||
const sectionListRef = useRef(); | ||
const listRef = useRef(); | ||
const listRef = useCombinedRefs([ref || null]); | ||
const [visibleItems, setVisibleItems] = useState(items); | ||
@@ -202,1 +203,2 @@ const { getColor } = useTheme(); | ||
} | ||
export const List = React.forwardRef(ListComponent); |
{ | ||
"name": "native-x-list", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "List component", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22764
9
270