Skip to main content
Version: 0.5.0

RTVRefreshControl

A refresh control component that automatically handles progressViewOffset for collapsible headers. Use this instead of React Native's RefreshControl when your tab view has a collapsible header.

import { RTVRefreshControl } from 'reanimated-tab-view';

Props

RTVRefreshControl accepts all standard React Native RefreshControlProps:

PropTypeDescription
refreshingbooleanWhether the refresh indicator is active.
onRefresh() => voidCallback when a pull-to-refresh is triggered.
colorsstring[]Spinner colors (Android).
tintColorstringSpinner color (iOS).
titlestringTitle shown below the spinner (iOS).
...and all other RefreshControlProps

The progressViewOffset prop is automatically set based on the header and tab bar heights, so you don't need to provide it.

Usage

import { RTVScrollView, RTVRefreshControl } from 'reanimated-tab-view';

const MyTab = () => {
const [refreshing, setRefreshing] = React.useState(false);

const onRefresh = () => {
setRefreshing(true);
fetchData().then(() => setRefreshing(false));
};

return (
<RTVScrollView
refreshControl={
<RTVRefreshControl refreshing={refreshing} onRefresh={onRefresh} />
}
>
{/* content */}
</RTVScrollView>
);
};