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

Function HookComponent

src/__tests__/useInView.test.tsx:12–25  ·  view source on GitHub ↗
({
  options,
  unmount,
}: {
  options?: IntersectionOptions;
  unmount?: boolean;
})

Source from the content-addressed store, hash-verified

10import { useInView } from "../useInView";
11
12const HookComponent = ({
13 options,
14 unmount,
15}: {
16 options?: IntersectionOptions;
17 unmount?: boolean;
18}) => {
19 const [ref, inView] = useInView(options);
20 return (
21 <div data-testid="wrapper" ref={!unmount ? ref : undefined}>
22 {inView.toString()}
23 </div>
24 );
25};
26
27const LazyHookComponent = ({ options }: { options?: IntersectionOptions }) => {
28 const [isLoading, setIsLoading] = React.useState(true);

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…