Implement a hook useBreakpoint(breakpoints) that returns the current breakpoint name depending on the window width.
The hook should:
window.innerWidth.Examples
const breakpoints = { mobile: 0, tablet: 768, desktop: 1024 }; useBreakpoint(breakpoints); // returns "mobile", "tablet", or "desktop" based on window width
JavaScript Function
No test results yet
Click "Run" to execute tests