MCPcopy Create free account
hub / github.com/bvaughn/react-virtualized / Header

Function Header

integrations/vite/src/components/Header.tsx:6–24  ·  view source on GitHub ↗
({ initialHeight }: { initialHeight: number })

Source from the content-addressed store, hash-verified

4// Its height is state of its own (changed through window.setHeaderHeight),
5// so that changing it does not re-render the virtualized component.
6export function Header({ initialHeight }: { initialHeight: number }) {
7 const [height, setHeight] = useState(initialHeight);
8
9 useEffect(() => {
10 window.setHeaderHeight = setHeight;
11 return () => {
12 window.setHeaderHeight = null;
13 };
14 }, []);
15
16 return (
17 <div
18 data-test-id="header"
19 style={{ height, backgroundColor: "lightblue", flexShrink: 0 }}
20 >
21 Header
22 </div>
23 );
24}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected