@maherunlocker/custom-react-table
Version:
dynamic table based on react table v7
14 lines • 570 B
JavaScript
import React from 'react';
export function IsMobileView() {
// eslint-disable-next-line
const [width, setWidth] = React.useState(window.innerWidth);
const breakpoint = 767;
React.useEffect(() => {
const handleWindowResize = () => setWidth(window.innerWidth);
window.addEventListener('resize', handleWindowResize);
return () => window.removeEventListener('resize', handleWindowResize);
}, []);
// Return the width of page
return width < breakpoint ? true : false;
}
//# sourceMappingURL=isMobileView.js.map