From 1cc41834f5cd742fa05835868c45a209f68a3a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20G=C3=BCdelh=C3=B6fer?= Date: Mon, 7 Jul 2025 15:50:46 +0200 Subject: [PATCH] Fix nullablity in react-19 --- src/useHoverDirty.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/useHoverDirty.ts b/src/useHoverDirty.ts index 8103a495bb..e58beab313 100644 --- a/src/useHoverDirty.ts +++ b/src/useHoverDirty.ts @@ -2,9 +2,9 @@ import { RefObject, useEffect, useState } from 'react'; import { off, on } from './misc/util'; // kudos: https://usehooks.com/ -const useHoverDirty = (ref: RefObject | null, enabled: boolean = true) => { +const useHoverDirty = (ref: RefObject, enabled: boolean = true) => { if (process.env.NODE_ENV === 'development') { - if (ref != null && (typeof ref !== 'object' || typeof ref?.current === 'undefined')) { + if (typeof ref !== 'object' || typeof ref?.current === 'undefined') { console.error('useHoverDirty expects a single ref argument.'); } }