useBreakpoint

Current breakpoint:
<Text>
  Current breakpoint: <Strong>{useBreakpoint()}</Strong>
</Text>
  • Box For custom layouts.
This Hook will return the breakpoint the browser viewport currently falls within (mobile, tablet, desktop). To maintain backwards compatibility, breakpoints above desktop will still be reported as desktop. As this can only be calculated in the browser, the value will also be null when rendering server-side or statically rendering. Window resizing is supported.
const breakpoint = useBreakpoint()

return <Text>Current breakpoint: {breakpoint}</Text>