import { ScrollView } from '@/components/ui/scroll-view'; import { Text } from '@/components/ui/text'; import { View } from '@/components/ui/view'; import { useColor } from '@/hooks/useColor'; import { BORDER_RADIUS } from '@/theme/globals'; import React, { useCallback, useState } from 'react'; import { RefreshControl } from 'react-native'; export function ScrollViewRefresh() { const card = useColor('card'); const green = useColor('green'); const [refreshing, setRefreshing] = useState(false); const [lastRefresh, setLastRefresh] = useState( new Date().toLocaleTimeString() ); const onRefresh = useCallback(() => { setRefreshing(true); setTimeout(() => { setRefreshing(false); setLastRefresh(new Date().toLocaleTimeString()); }, 2000); }, []); return ( } > Pull to Refresh Last refreshed: {lastRefresh} {Array.from({ length: 15 }, (_, i) => ( News Item {i + 1} This is a sample news item that demonstrates the pull-to-refresh functionality. ))} ); }