Function useMediaQuery

  • Test a media query

    Example

    const MyComponent = () => {
    const screenIsSmall = useMediaQuery('(max-width: 800px)');
    return <div>{screenIsSmall ? "small screen" : "big screen"}</div>
    }

    Parameters

    • query: string

      The media query to test

    Returns boolean

    Boolean indicating if the query currently matches

Generated using TypeDoc