UNPKG

react-native-scroll-into-view

Version:

React-Native port of DOMElement.scrollIntoView() web function, for ScrollView

49 lines (48 loc) 2.04 kB
import React, { ReactNode, ReactNodeArray } from 'react'; import PropTypes from 'prop-types'; import { View, ViewProps } from 'react-native'; import { PartialOptions } from './config'; import { ScrollIntoViewAPI } from './api'; declare type ContainerProps = { enabled?: boolean; scrollIntoViewKey?: string | number | boolean; animated?: boolean; immediate?: boolean; onMount?: boolean; onUpdate?: boolean; scrollIntoViewOptions?: PartialOptions; scrollIntoViewAPI?: ScrollIntoViewAPI; children?: ReactNode | ReactNodeArray; } & PartialOptions & ViewProps; export declare class ContainerBase extends React.Component<ContainerProps> { static propTypes: { enabled: PropTypes.Validator<boolean>; scrollIntoViewKey: PropTypes.Requireable<string | number | boolean>; animated: PropTypes.Validator<boolean>; immediate: PropTypes.Validator<boolean>; onMount: PropTypes.Validator<boolean>; onUpdate: PropTypes.Validator<boolean>; }; container: React.RefObject<View>; static defaultProps: Partial<ContainerProps>; unmounted: boolean; ensureApiProvided: () => boolean; componentDidMount(): void; componentDidUpdate(prevProps: ContainerProps): void; componentWillUnmount(): void; getPropsOptions: () => Partial<import("./config").FullOptions>; scrollIntoView: (providedOptions?: PartialOptions) => void; render(): JSX.Element; } export declare const Container: React.ForwardRefExoticComponent<{ enabled?: boolean | undefined; scrollIntoViewKey?: string | number | boolean | undefined; animated?: boolean | undefined; immediate?: boolean | undefined; onMount?: boolean | undefined; onUpdate?: boolean | undefined; scrollIntoViewOptions?: Partial<import("./config").FullOptions> | undefined; scrollIntoViewAPI?: ScrollIntoViewAPI | undefined; children?: ReactNode | ReactNodeArray; } & Partial<import("./config").FullOptions> & ViewProps & React.RefAttributes<ContainerBase>>; export {};