import { useState } from 'react' ; import { useMount } from '../useMount' ; param predicate see https export function useIsSupported ( predicate ) { const [ isSupported , setIsSupported ] = useState ( false ) ; useMount ( ( ) => { setIsSupported ( predicate ( ) ) ; } ) ; return isSupported ; }