MCPcopy Create free account
hub / github.com/streamich/react-use / TestComponent

Function TestComponent

tests/useWindowScroll.test.tsx:111–122  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

109 setWindowScroll(initialScroll.x, initialScroll.y);
110
111 const TestComponent = () => {
112 useEffect(() => {
113 // Simulate window scroll changing between component render and useWindowScroll effect handler,
114 // before adding the event listener
115 setWindowScroll(afterRenderScroll.x, afterRenderScroll.y);
116 }, []);
117
118 const { x, y } = useWindowScroll();
119 result.x = x;
120 result.y = y;
121 return <div />;
122 };
123
124 const { rerender } = render(<TestComponent />);
125 rerender(<TestComponent />);

Callers

nothing calls this directly

Calls 2

setWindowScrollFunction · 0.85
useWindowScrollFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…