import { useState } from 'react' ; export function useBoolean ( initialValue = false ) { const [ val , setVal ] = useState ( initialValue ) ; const toTrue = ( ) => setVal ( true ) ; const toFalse = ( ) => setVal ( false ) ; return [ val , toTrue , toFalse ] ; }