1
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:
2022-01-06 19:58:07 -05:00
parent 66a244a9c1
commit 17375ef876
19 changed files with 2515 additions and 2572 deletions

View File

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