mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-13 23:16:47 +00:00
Adding fix for footer icons after rehydration
This commit is contained in:
@@ -11,6 +11,7 @@ export const Footer: React.FC<{
|
||||
isDarkMode: boolean
|
||||
toggleDarkMode: () => void
|
||||
}> = ({ isDarkMode, toggleDarkMode }) => {
|
||||
const [hasMounted, setHasMounted] = React.useState(false)
|
||||
const toggleDarkModeCb = React.useCallback(
|
||||
(e) => {
|
||||
e.preventDefault()
|
||||
@@ -19,6 +20,14 @@ export const Footer: React.FC<{
|
||||
[toggleDarkMode]
|
||||
)
|
||||
|
||||
React.useEffect(() => {
|
||||
setHasMounted(true)
|
||||
}, [])
|
||||
|
||||
if (!hasMounted) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<footer className={styles.footer}>
|
||||
<div className={styles.copyright}>Copyright 2021 {config.author}</div>
|
||||
|
||||
Reference in New Issue
Block a user