Skip to content

Commit 8a64b83

Browse files
authored
Merge pull request #186 from Podo-Store/refactor/outerwidth-to-innerwidth
refactor: 반응형 outerWidth to innerWidth (#185)
2 parents 6715d40 + 14186dd commit 8a64b83

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/hooks/useWindowDimensions.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@ import { useEffect, useState } from "react";
22

33
const useWindowDimensions = () => {
44
const [windowDimensions, setWindowDimensions] = useState({
5-
width: window.outerWidth,
6-
height: window.outerHeight,
5+
width: window.innerWidth,
6+
height: window.innerHeight,
77
widthConditions: {
8-
isMobile: window.outerWidth < 768,
9-
isTablet: window.outerWidth < 1280,
10-
isLaptop: window.outerWidth < 1920,
11-
isDesktop: window.outerWidth >= 1920,
8+
isMobile: window.innerWidth < 768,
9+
isTablet: window.innerWidth < 1280,
10+
isLaptop: window.innerWidth < 1920,
11+
isDesktop: window.innerWidth >= 1920,
1212
},
1313
});
1414

1515
useEffect(() => {
1616
const handleResize = () => {
1717
setWindowDimensions({
18-
width: window.outerWidth,
19-
height: window.outerHeight,
18+
width: window.innerWidth,
19+
height: window.innerHeight,
2020
widthConditions: {
21-
isMobile: window.outerWidth < 768,
22-
isTablet: window.outerWidth < 1280,
23-
isLaptop: window.outerWidth < 1920,
24-
isDesktop: window.outerWidth >= 1920,
21+
isMobile: window.innerWidth < 768,
22+
isTablet: window.innerWidth < 1280,
23+
isLaptop: window.innerWidth < 1920,
24+
isDesktop: window.innerWidth >= 1920,
2525
},
2626
});
2727
};

0 commit comments

Comments
 (0)