Update formatting

This commit is contained in:
Isabelle Viktoria Maciohsek
2022-01-30 19:40:51 +02:00
parent d69d13ee26
commit 790f0de37f
5 changed files with 5 additions and 5 deletions

View File

@ -7,7 +7,7 @@ firstSeen: 2021-09-10T05:00:00-04:00
Observes visibility changes for a given element.
- Use the `useState()` hook to store the intersection value of the given element.
- Create an `IntersectionObserver()` with the given `options` and an appropriate callback to update the `isIntersecting` state variable.
- Create an `IntersectionObserver` with the given `options` and an appropriate callback to update the `isIntersecting` state variable.
- Use the `useEffect()` hook to call `IntersectionObserver.observe()` when mounting the component and clean up using `IntersectionObserver.unobserve()` when unmounting.
```jsx