UNPKG

lazy-child

Version:

React component that renders its child when it enters the viewport

3 lines (2 loc) 290 B
import e,{useState as r,Fragment as t}from"react";import{useIntersectionChange as l}from"react-peekaboo";export default function({children:o,renderPlaceholder:n,...a}){let[c,d]=r(!1),m=l(d,{enabled:!c,...a});return e.createElement(t,null,c?o:n(m))} //# sourceMappingURL=index.modern.js.map