Skip to content
Docs
Hooks
useMediaQuery

useMediaQuery

useMediaQuery is a custom hook used to help detect if the window width is between 2 values.

Import

import { useMediaQuery } from 'react-native-ficus-ui';

Usage

const [isSmallScreen] = useMediaQuery({
  minWidth: 280,
  maxWidth: 480,
});
 
const [isSmallScreen, isBigScreen] = useMediaQuery(
  {
    minWidth: 280,
    maxWidth: 480,
  },
  {
    minWidth: 481,
  }
);