mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-12-02 15:31:49 -05:00
static header and footer were being re-rendered on every route change
This commit is contained in:
19 files changed
+2515
-2572
No files matched your search
@@ -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