diff --git a/components/JumpToTop.js b/components/JumpToTop.js index 3dfcd209..4ead6b10 100644 --- a/components/JumpToTop.js +++ b/components/JumpToTop.js @@ -16,7 +16,7 @@ const JumpToTop = ({ targetRef, showPercent = true }) => { const [percent, changePercent] = useState(0) const scrollListener = useCallback(throttle(() => { // 处理是否显示回到顶部按钮 - const clientHeight = targetRef ? (targetRef.current.clientHeight) : 0 + const clientHeight = targetRef ? (targetRef.current ? targetRef.current.clientHeight : 0) : 0 const scrollY = window.pageYOffset const fullHeight = clientHeight - window.outerHeight const shouldShow = scrollY > 100 diff --git a/components/MenuButtonGroup.js b/components/MenuButtonGroup.js index 37100c01..cf349c2e 100644 --- a/components/MenuButtonGroup.js +++ b/components/MenuButtonGroup.js @@ -29,7 +29,7 @@ const MenuButtonGroup = ({ allowCollapse = false }) => {
-
{link.name}
+
{link.name}
) )} diff --git a/components/SideBar.js b/components/SideBar.js index fd641d46..450e0ba8 100644 --- a/components/SideBar.js +++ b/components/SideBar.js @@ -8,11 +8,9 @@ const SideBar = ({ tags, currentTag, post }) => {