From 158b467fff07981b43af81f6520d3dba06baeffa Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 10 Jul 2023 16:34:09 +0800 Subject: Run react-codemod update-react-imports --- FrontEnd/src/utilities/hooks/useScrollToBottom.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'FrontEnd/src/utilities/hooks/useScrollToBottom.ts') diff --git a/FrontEnd/src/utilities/hooks/useScrollToBottom.ts b/FrontEnd/src/utilities/hooks/useScrollToBottom.ts index f6780d9f..216746f4 100644 --- a/FrontEnd/src/utilities/hooks/useScrollToBottom.ts +++ b/FrontEnd/src/utilities/hooks/useScrollToBottom.ts @@ -1,4 +1,4 @@ -import React from "react"; +import { useRef, useEffect } from "react"; import { fromEvent } from "rxjs"; import { filter, throttleTime } from "rxjs/operators"; @@ -10,9 +10,9 @@ function useScrollToBottom( throttle: 1000, } ): void { - const handlerRef = React.useRef<(() => void) | null>(null); + const handlerRef = useRef<(() => void) | null>(null); - React.useEffect(() => { + useEffect(() => { handlerRef.current = handler; return () => { @@ -20,7 +20,7 @@ function useScrollToBottom( }; }, [handler]); - React.useEffect(() => { + useEffect(() => { const subscription = fromEvent(window, "scroll") .pipe( filter( -- cgit v1.2.3