UNPKG

@crossed/ui

Version:

A universal & performant styling library for React Native, Next.js & React

17 lines (16 loc) 435 B
import { useWindowDimensions } from "react-native"; import { cacheBreakpoints } from "@crossed/styled"; const useMedia = () => { const { width } = useWindowDimensions(); return { xs: cacheBreakpoints.xs < width, sm: cacheBreakpoints.sm < width, md: cacheBreakpoints.md < width, lg: cacheBreakpoints.lg < width, xl: cacheBreakpoints.xl < width }; }; export { useMedia }; //# sourceMappingURL=useMedia.js.map