Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 423 Bytes

README.md

File metadata and controls

9 lines (7 loc) · 423 Bytes

React-useScreenSize-Hook

This hook is useful when a component needs to render based on screen breakpoints. It contains two states (breakpoint, screen) and two helper functions (getScreen, getBreakpoint).

import useScreenSize from './use_screen_size.js';
const [breakpoint, screen, getScreen, getBreakpoint] = useScreenSize();
console.log(breakpoint, screen, getScreen(1280), getBreakpoint("lg"));