Custom React hook that checks if the current viewport breakpoint is 'phone'.
const MyComponent = () => { const isPhone = useIsViewportPhone(); return ( <div> {isPhone ? 'Viewport is of phone size.' : 'Not phone.'} </div> );};
Custom React hook that checks if the current viewport breakpoint is 'phone'.
Example