@codecraftkit
Documentation
The useNearScreen is used to render components in a lazy way, it uses the browser api IntersectionObserver.
bashjsx live=false npm i @codecraftkit/use-near-screen
## Importit can be imported from hooks.```jsx live=falseimport { useNearScreen } from "@codecraftkit/hooks";```or alone.```jsx live=falseimport { useNearScreen } from "@codecraftkit/use-near-screen";```## UsageThis hook allows you to to hide a component that is not in the view```jsx live=falsefunction MyApp() {const [show, element] = useNearScreen()return <Grid><Box h="500px">1</Box><Box h="500px">2</Box><Box h="500px">3</Box><Box h="500px">4</Box><Box h="500px">5</Box><Box h="500px" ref={element}>{show && <Box> // item to hide6</Box>}</Box></Grid>}```## ArgumentsIt doesn't take any arguments## Results<PropsList propsData={useNearScreenResults} headProps={headResults} />