import React from "react"; import { Box } from "theme-ui"; import { useInView } from "react-intersection-observer"; function LazyTile({ children }) { const [ref, inView] = useInView({ triggerOnce: false }); const sx = inView ? {} : { width: "100%", height: "0", paddingTop: "100%", position: "relative" }; return ( {inView ? ( children ) : ( )} ); } export default LazyTile;