UNPKG

@tapie-kr/inspire-react

Version:

React Component Collection for INSPIRE

20 lines (17 loc) 906 B
/* eslint-disable */ /* * INSPIRE : Creative Kit * React Component Collection for INSPIRE * * This file is generated automatically. Do not modify it manually * Generated at : 2025. 3. 4. 오후 6:18:13 * @tapie-kr/inspire-react version: 0.2.15 * * (c) 2025 TAPIE. All rights reserved. * MIT License */ import { useSetAtom } from 'jotai'; import { useEffect } from 'react'; import { viewportWidthAtom } from '../../../../lib/atoms.js'; function CheckMobileService(){const setViewportWidth=useSetAtom(viewportWidthAtom);useEffect(()=>{const handleResize=()=>{const clientWidth=document.documentElement.clientWidth;const visualViewportWidth=window.visualViewport?.width;setViewportWidth(visualViewportWidth||clientWidth);};handleResize();window.addEventListener("resize",handleResize);return ()=>{window.removeEventListener("resize",handleResize);}},[]);return null} export { CheckMobileService };