@anton.bobrov/react-vevet-hooks
Version:
A collection of custom React hooks designed to seamlessly integrate with the `Vevet` library
20 lines • 548 B
JavaScript
import { useBreakpointName } from './useBreakpointName';
/**
* Custom React hook that checks if the current viewport breakpoint is 'phone'.
*
* @example
* const MyComponent = () => {
* const isPhone = useIsViewportPhone();
*
* return (
* <div>
* {isPhone ? 'Viewport is of phone size.' : 'Not phone.'}
* </div>
* );
* };
*/
export function useIsViewportPhone() {
var breakpointName = useBreakpointName();
return breakpointName === 'phone';
}
//# sourceMappingURL=useIsViewportPhone.js.map