[React] 디바이스 구분하기
2023. 6. 15. 20:48
프로그래밍/React
리액트에서 디바이스 구분하기 export const isAndroid = () => { return /android/i.test(navigator.userAgent); } export const isiOS = () => { return /iphone|ipad/i.test(navigator.userAgent); } export const isiPhone = () => { return /iphone/i.test(navigator.userAgent); } export const isiPad = () => { return /ipad/i.test(navigator.userAgent); } export const isMobile = () => { return isAndroid() || isiOS(); } expor..