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