MCPcopy Create free account
hub / github.com/adobe/react-spectrum / onResize

Function onResize

packages/dev/s2-docs/pages/s2/home/ExampleApp2.tsx:85–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

83 useResizeObserver({
84 ref,
85 onResize() {
86 let width = ref.current!.getBoundingClientRect().width;
87 let rem = parseFloat(window.getComputedStyle(document.documentElement).fontSize);
88 let breakpoint = width / rem;
89 flushSync(() => {
90 let matches = breakpoint >= SM_BREAK;
91 setLarge(matches);
92 if (!showPanel && selectedPanel && isLarge && !matches) {
93 setPanel(null);
94 }
95 });
96 }
97 });
98
99 return (

Callers 1

TabLineFunction · 0.50

Calls 1

setPanelFunction · 0.85

Tested by

no test coverage detected