aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/utilities/hooks/useScrollToBottom.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2023-07-10 16:34:09 +0800
committercrupest <crupest@outlook.com>2023-07-10 16:34:09 +0800
commit158b467fff07981b43af81f6520d3dba06baeffa (patch)
treec24d0e32fc09d3e94849812de977b517760cda95 /FrontEnd/src/utilities/hooks/useScrollToBottom.ts
parent4363f625025edeb19fb480a00e2e3b460c6091a9 (diff)
downloadtimeline-158b467fff07981b43af81f6520d3dba06baeffa.tar.gz
timeline-158b467fff07981b43af81f6520d3dba06baeffa.tar.bz2
timeline-158b467fff07981b43af81f6520d3dba06baeffa.zip
Run react-codemod update-react-imports
Diffstat (limited to 'FrontEnd/src/utilities/hooks/useScrollToBottom.ts')
-rw-r--r--FrontEnd/src/utilities/hooks/useScrollToBottom.ts8
1 files changed, 4 insertions, 4 deletions
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(