Skip to content

Commit

Permalink
Trying to appease build
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-cedrone-cengage committed Jan 23, 2025
1 parent 8ade055 commit 955bbd5
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions packages/react-magma-dom/src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,24 +172,25 @@ export const Table = React.forwardRef<HTMLTableElement, TableProps>(

const [windowWidth, setWindowWidth] = React.useState(window.innerWidth);

React.useEffect(() => {
function handleResize() {
setWindowWidth(window.innerWidth);
if (window.innerWidth < minWidth && minWidth) {
setTableOverFlow('auto');
if (typeof window !== 'undefined') {
React.useEffect(() => {
function handleResize() {
setWindowWidth(window.innerWidth);
if (window.innerWidth < minWidth && minWidth) {
setTableOverFlow('auto');
}

if (window.innerWidth > minWidth) {
setTableOverFlow('visible');
}
}

if (window.innerWidth > minWidth) {
setTableOverFlow('visible');
}
}

window.addEventListener('resize', handleResize);
handleResize();

return () => window.removeEventListener('resize', handleResize);
}, [windowWidth]);
window.addEventListener('resize', handleResize);
handleResize();

return () => window.removeEventListener('resize', handleResize);
}, [windowWidth]);
}
return (
<TableContext.Provider
value={{
Expand Down

0 comments on commit 955bbd5

Please sign in to comment.