From 320be8b727fb6ef43804161007ad52f581187ee8 Mon Sep 17 00:00:00 2001 From: nuintun Date: Thu, 27 Jun 2024 21:02:17 +0800 Subject: [PATCH] feat: Update hooks --- src/hooks/useLatestRef.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hooks/useLatestRef.ts b/src/hooks/useLatestRef.ts index 3bc56ce..e0de162 100644 --- a/src/hooks/useLatestRef.ts +++ b/src/hooks/useLatestRef.ts @@ -2,25 +2,25 @@ * @module useLatestRef */ -import React, { useMemo, useRef } from 'react'; +import { MutableRefObject, useMemo, useRef } from 'react'; /** * @function useLatestRef * @description 生成自更新 useRef 对象 */ -export function useLatestRef(): React.MutableRefObject; +export function useLatestRef(): MutableRefObject; /** * @function useLatestRef * @description 生成自更新 useRef 对象 * @param value 引用值 */ -export function useLatestRef(value: T): React.MutableRefObject; +export function useLatestRef(value: T): MutableRefObject; /** * @function useLatestRef * @description 生成自更新 useRef 对象 * @param value 引用值 */ -export function useLatestRef(value?: T): React.MutableRefObject { +export function useLatestRef(value?: T): MutableRefObject { const valueRef = useRef(value); // https://github.com/alibaba/hooks/issues/728