📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
scrooltotop fix error
Maksim Mrugb340d2ed0cad
diff --git a/app/hoc/ScrollToTop.tsx b/app/hoc/ScrollToTop.tsxindex f7ec50130..6dd385362 100644--- a/app/hoc/ScrollToTop.tsx+++ b/app/hoc/ScrollToTop.tsx@@ -1,5 +1,5 @@import React, { useEffect } from 'react'-import { useHistory } from 'react-router-dom'+import { useNavigate } from '@remix-run/react'import _isEmpty from 'lodash/isEmpty'interface IScrollToTop {@@ -29,29 +29,29 @@ interface IHistoryListener {* @param {HTMLElement} children The children covered by the listener.*/const ScrollToTop: React.FC<IScrollToTop> = ({ children }) => {- const history = useHistory()-- useEffect(() => {- const unlisten = history.listen((location: any) => {- const { hash, state } = location as IHistoryListener-- if (!_isEmpty(state) && state?.scrollToTopDisable) {- return- }-- if (hash !== '') {- return- }-- setTimeout(() => {- window.scrollTo({- top: 0,- behavior: 'smooth',- })- }, 0)- })- return unlisten- }, [history])+ const history = useNavigate()++ // useEffect(() => {+ // const unlisten = useNavigate.listen((location: any) => {+ // const { hash, state } = location as IHistoryListener++ // if (!_isEmpty(state) && state?.scrollToTopDisable) {+ // return+ // }++ // if (hash !== '') {+ // return+ // }++ // setTimeout(() => {+ // window.scrollTo({+ // top: 0,+ // behavior: 'smooth',+ // })+ // }, 0)+ // })+ // return unlisten+ // }, [history])return children}