[bugfix] Fix the error: Uncaught TypeError: Cannot read properties of null (reading 'scrollTop')

I just put Early return, though.
This commit is contained in:
Sakamoto Shiina
2024-11-21 19:02:09 +09:00
parent 737cdf15cf
commit f2487e2ea6

View File

@@ -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;