import { useCallback , useEffect , useState } from 'react' ; import { hasAction } from 'expo-store-review' ; see https example export function useStoreReviewHasAction ( options = { } ) { const [ storeReviewHasAction , setStoreReviewHasAction ] = useState < boolean > ( ) ; const { get = true } = options ; const getStoreReviewHasAction = useCallback ( ( ) => ( hasAction ( ) . then ( setStoreReviewHasAction ) ) , [ ] ) ; useEffect ( ( ) => { if ( get ) { getStoreReviewHasAction ( ) ; } } , [ get , getStoreReviewHasAction ] ) ; return [ storeReviewHasAction , getStoreReviewHasAction ] ; } export interface StoreReviewHasActionOptions { /** If it should fetch the store review has action when mounted, defaults to `true` */ get ? : boolean ; }