[bugfix] Fix the error: Uncaught TypeError: Cannot read properties of null (reading 'scrollTop')
I just put Early return, though.
This commit is contained in:
@@ -21,6 +21,7 @@ export const LogBox = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleScroll = () => {
|
const handleScroll = () => {
|
||||||
const element = log_container_ref.current;
|
const element = log_container_ref.current;
|
||||||
|
if (!element) return;
|
||||||
const currentScrollTop = element.scrollTop;
|
const currentScrollTop = element.scrollTop;
|
||||||
const at_bottom = element.scrollHeight - currentScrollTop === element.clientHeight;
|
const at_bottom = element.scrollHeight - currentScrollTop === element.clientHeight;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user