aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/utilities/hooks/useScrollToBottom.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2023-07-11 01:07:57 +0800
committerGitHub <noreply@github.com>2023-07-11 01:07:57 +0800
commita702dff4b62090a4e5453a8b9236824288df0c4f (patch)
tree0deae7f40692345c8e4b1473cdddbd13e0e5586d /FrontEnd/src/utilities/hooks/useScrollToBottom.ts
parent4cb87464fea217e1d0969747d6a17e88973982e7 (diff)
parentd46b1aed549938c9f5e3e658b4098e71b5e2acf7 (diff)
downloadtimeline-a702dff4b62090a4e5453a8b9236824288df0c4f.tar.gz
timeline-a702dff4b62090a4e5453a8b9236824288df0c4f.tar.bz2
timeline-a702dff4b62090a4e5453a8b9236824288df0c4f.zip
Merge pull request #1381 from crupest/front-dev
Re-bootstrap front end.
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(