هوکها
توابع
کامپوننتهای مرتبه بالا
useResponsive
هوک useResponsive برای دریافت اطلاعات واکنشگرا استفاده میشود
مثال
'use client'
import useResponsive from '@/utils/hooks/useResponsive'
const Component = () => {
const { larger, smaller, windowWidth } = useResponsive()
return (...)
}
| بازگشتی | توضیحات | نوع | پیشفرض |
|---|---|---|---|
| larger | نقاط شکست با شرط بزرگتر از عرض پنجره فعلی | {2xl: boolean, xl: boolean, lg: boolean, md: boolean, sm: boolean, xs: boolean} | - |
| smaller | نقاط شکست با شرط کوچکتر از عرض پنجره فعلی | {2xl: boolean, xl: boolean, lg: boolean, md: boolean, sm: boolean, xs: boolean} | - |
| windowWidth | عرض فعلی پنجره | number | - |