import { useEffect } from 'react';
import isBrowser from '../../isBrowser';
function useDocumentTitle(titleInfo, appDefaultTitle) {
  const titleText = typeof titleInfo.pageName === 'string' ? titleInfo.title : appDefaultTitle;
  useEffect(() => {
    if (isBrowser() && titleText) {
      document.title = titleText;
    }
  }, [titleInfo.title]);
}
export default useDocumentTitle;