Skip to content

Commit ad04dbd

Browse files
authored
Merge pull request #8 from opencreek/update-fork-17-6-0
Fix nullablity in react-19
2 parents 7b3b826 + 370cc06 commit ad04dbd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/useHoverDirty.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { RefObject, useEffect, useState } from 'react';
22
import { off, on } from './misc/util';
33

44
// kudos: https://usehooks.com/
5-
const useHoverDirty = (ref: RefObject<Element> | null, enabled: boolean = true) => {
5+
const useHoverDirty = (ref: RefObject<Element | null>, enabled: boolean = true) => {
66
if (process.env.NODE_ENV === 'development') {
7-
if (ref != null && (typeof ref !== 'object' || typeof ref?.current === 'undefined')) {
7+
if (typeof ref !== 'object' || typeof ref?.current === 'undefined') {
88
console.error('useHoverDirty expects a single ref argument.');
99
}
1010
}

0 commit comments

Comments
 (0)