You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/react-intersection-observer-hook/README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@
10
10
11
11
<!-- ALL-CONTRIBUTORS-BADGE:END -->
12
12
13
-
This is a easy to use React hook package for using [Insersection Observer](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API) declaratively. By using this hook, you can easily track if a component is visible or not, create lazy loading images, trigger animations on entering or leaving the viewport, implement infinite scroll etc.
13
+
This is an easy to use React hook package for using [Insersection Observer](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API) declaratively. By using this hook, you can easily track if a component is visible or not, create lazy loading images, trigger animations on entering or leaving the viewport, implement infinite scroll etc.
14
14
15
15
**Live demo is [here](https://onderonur.github.io/react-intersection-observer-hook).**
16
16
@@ -107,6 +107,10 @@ function Example() {
107
107
}
108
108
```
109
109
110
+
> [!NOTE]
111
+
> The returned `ref` from `useIntersectionObserver` and `useTrackVisibility` can be attached to **only** one element at a time. If you assign it to multiple elements, only the most recently assigned element will be observed.
112
+
> Currently, there is no support for observing multiple elements by using the same `ref`. Documentation will be updated when this is implemented.
113
+
110
114
You can find more usage examples in the `demo` app in this repository.
0 commit comments