mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-09-17 17:15:33 -04:00
static header and footer were being re-rendered on every route change
This commit is contained in:
@@ -9,7 +9,10 @@ const ThemeToggle = ({ className = "" }) => {
|
||||
// avoid hydration mismatch:
|
||||
// https://github.com/pacocoursey/next-themes#avoid-hydration-mismatch
|
||||
useEffect(() => setMounted(true), []);
|
||||
if (!mounted) return null;
|
||||
if (!mounted) {
|
||||
// always return one of the bulbs just so there are never flashing layout shifts
|
||||
return <BulbOffIcon className={`icon ${className}`} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<button
|
||||
|
Reference in New Issue
Block a user