import { useMemo } from 'react' ; const useDocumentTitle = ( title ? ) => { useMemo ( ( ) => { if ( title === undefined ) { return ; } document . title = title ; } , [ title ] ) ; } ; export default useDocumentTitle ;