this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at e28f6d2f370b4e882ed6f23d08ca0f8d94dbac5f 17 lines 380 B view raw
1import {useCallback, useRef} from 'react' 2import {useFocusEffect} from '@react-navigation/native' 3 4export function useRefreshOnFocus<T>(refetch: () => Promise<T>) { 5 const firstTimeRef = useRef(true) 6 7 useFocusEffect( 8 useCallback(() => { 9 if (firstTimeRef.current) { 10 firstTimeRef.current = false 11 return 12 } 13 14 refetch() 15 }, [refetch]), 16 ) 17}