MCPcopy Index your code
hub / github.com/thebuilder/react-intersection-observer / HookComponent

Function HookComponent

src/__tests__/browser.test.tsx:9–22  ·  view source on GitHub ↗
({ options }: { options?: IntersectionOptions })

Source from the content-addressed store, hash-verified

7});
8
9const HookComponent = ({ options }: { options?: IntersectionOptions }) => {
10 const [ref, inView] = useInView(options);
11
12 return (
13 <div
14 ref={ref}
15 data-testid="wrapper"
16 style={{ height: 200, background: "cyan" }}
17 data-inview={inView}
18 >
19 InView block
20 </div>
21 );
22};
23
24test("should come into view on after rendering", async () => {
25 render(<HookComponent />);

Callers

nothing calls this directly

Calls 1

useInViewFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…