Skip to content

Commit 2142fef

Browse files
committed
refactor: replace deprecated types in React 19
1 parent 8cc5a98 commit 2142fef

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/components/Tooltip/use-tooltip-events.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect, useMemo, useRef } from 'react'
2-
import type { MutableRefObject } from 'react'
2+
import type { RefObject } from 'react'
33
import { autoUpdate } from '@floating-ui/dom'
44
import {
55
debounce,
@@ -57,16 +57,16 @@ const useTooltipEvents = ({
5757
handleShow: (value: boolean) => void
5858
handleShowTooltipDelayed: (delay?: number) => void
5959
handleTooltipPosition: ({ x, y }: IPosition) => void
60-
hoveringTooltip: MutableRefObject<boolean>
60+
hoveringTooltip: RefObject<boolean>
6161
imperativeModeOnly?: boolean
62-
lastFloatPosition: MutableRefObject<IPosition | null>
62+
lastFloatPosition: RefObject<IPosition | null>
6363
openEvents?: AnchorOpenEvents
6464
openOnClick: boolean
6565
setActiveAnchor: (anchor: HTMLElement | null) => void
6666
show: boolean
67-
tooltipHideDelayTimerRef: MutableRefObject<NodeJS.Timeout | null>
68-
tooltipRef: MutableRefObject<HTMLElement | null>
69-
tooltipShowDelayTimerRef: MutableRefObject<NodeJS.Timeout | null>
67+
tooltipHideDelayTimerRef: RefObject<NodeJS.Timeout | null>
68+
tooltipRef: RefObject<HTMLElement | null>
69+
tooltipShowDelayTimerRef: RefObject<NodeJS.Timeout | null>
7070
updateTooltipPosition: () => void
7171
}) => {
7272
// Ref-stable debounced handlers — avoids recreating debounce instances on every effect run

src/utils/clear-timeout-ref.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const clearTimeoutRef = (ref: React.MutableRefObject<NodeJS.Timeout | null>) => {
1+
const clearTimeoutRef = (ref: React.RefObject<NodeJS.Timeout | null>) => {
22
if (ref.current) {
33
clearTimeout(ref.current)
44

0 commit comments

Comments
 (0)