Skip to content

Commit 7dde836

Browse files
fix: ref type useInView
1 parent 35f8b34 commit 7dde836

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# [Versions](https://github.com/Tracktor/react-utils/releases)
22

3-
## v1.22.0
4-
- **[feat]** : add `useInView` hook to observe visible element
3+
## v1.22.1
4+
- **[fix]** : useInView ref type

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@tracktor/react-utils",
33
"description": "React data table and react data grid",
4-
"version": "1.22.0",
4+
"version": "1.22.1",
55
"private": false,
66
"license": "ISC",
77
"type": "module",

src/hooks/useInView/useInView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export interface UseInViewOptions {
3636
* @param options - Configuration options for the Intersection Observer
3737
* @returns Boolean indicating if the element is in view
3838
*/
39-
export const useInView = (ref: RefObject<Element>, options: UseInViewOptions = {}): boolean => {
39+
export const useInView = (ref: RefObject<null | Element>, options: UseInViewOptions = {}): boolean => {
4040
const [isInView, setIsInView] = useState<boolean>(false);
4141
const { threshold = 0.1, root = null, rootMargin = "0px", triggerOnce = false } = options;
4242

0 commit comments

Comments
 (0)