We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 40a0a06 commit 43c5e6cCopy full SHA for 43c5e6c
1 file changed
src/components/HeroHeader/HeroHeader.tsx
@@ -4,16 +4,16 @@ import MobileHero from './MobileHero';
4
5
export default function HeroHeader() {
6
const [screenWidth, setScreenWidth] = useState<number | null>(() =>
7
- typeof window !== 'undefined' ? window.innerWidth : null,
+ typeof window !== 'undefined' ? window.innerWidth : null
8
);
9
10
const breakpoint = 768;
11
12
useEffect(() => {
13
const handleResize = () => setScreenWidth(window.innerWidth);
14
-
+
15
window.addEventListener('resize', handleResize);
16
17
return () => {
18
window.removeEventListener('resize', handleResize);
19
};
0 commit comments