Skip to main content

Posts

Showing posts from May, 2020

custom hook - useGeo

custom hook - useInterval

set state with data from useQuery

const { loading, data, error } = useQuery ( SOME_QUERY ) const [state, setState] = React . useState ([]) React . useEffect (() => { // do some checking here to ensure data exist if ( data ) { // mutate data if you need to setState ( data ) } }, [ data ])