UNPKG

@anton.bobrov/react-vevet-hooks

Version:

A collection of custom React hooks designed to seamlessly integrate with the `Vevet` library

24 lines (23 loc) 699 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useIsViewportTablet = void 0; var useBreakpointName_1 = require("./useBreakpointName"); /** * Custom React hook that checks if the current viewport breakpoint is 'tablet'. * * @example * const MyComponent = () => { * const isTablet = useIsViewportTablet(); * * return ( * <div> * {isTablet ? 'Viewport is of tablet size.' : 'Not tablet.'} * </div> * ); * }; */ function useIsViewportTablet() { var breakpointName = (0, useBreakpointName_1.useBreakpointName)(); return breakpointName === 'tablet'; } exports.useIsViewportTablet = useIsViewportTablet;