MCPcopy Create free account
hub / github.com/szhsin/react-menu / handleResize

Function handleResize

example/src/components/App.js:18–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16
17 useEffect(() => {
18 const handleResize = () => {
19 const info = {
20 // Viewport size
21 vWidth: document.documentElement.clientWidth,
22 vHeight: window.innerHeight,
23 navbarHeight: document.querySelector('#header').offsetHeight
24 };
25
26 if (info.vWidth > 950) isTocOpenState.set(false);
27 domInfoState.set(info);
28 };
29
30 handleResize();
31 window.addEventListener('resize', handleResize);

Callers 1

App.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…