const hasWindow = typeof window !== 'undefined'; const hasDocument = typeof document !== 'undefined'; export const isBrowser = hasWindow && hasDocument; export default isBrowser;