mirror of
https://github.com/zoriya/v10.git
synced 2026-08-09 15:46:42 +00:00
fix(site): work around Astro SSR false "Invalid hook call" warnings (#600)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
c4ef94e823
commit
c11395ece1
@@ -29,5 +29,7 @@ export function PreferenceSync() {
|
||||
}
|
||||
}, [framework]);
|
||||
|
||||
return null;
|
||||
// Workaround: Astro SSR logs false "Invalid hook call" when a React
|
||||
// component with hooks returns null. See withastro/astro#12283.
|
||||
return <></>;
|
||||
}
|
||||
|
||||
@@ -24,5 +24,7 @@ export function PreferenceUpdater({ currentFramework }: PreferenceUpdaterProps)
|
||||
styleStore.set(style);
|
||||
}, [currentFramework]);
|
||||
|
||||
return null;
|
||||
// Workaround: Astro SSR logs false "Invalid hook call" when a React
|
||||
// component with hooks returns null. See withastro/astro#12283.
|
||||
return <></>;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,9 @@ export function TableOfContents({ headings }: TableOfContentsProps) {
|
||||
const activeId = useActiveHeading(filteredHeadings);
|
||||
|
||||
if (filteredHeadings.length === 0) {
|
||||
return null;
|
||||
// Workaround: Astro SSR logs false "Invalid hook call" when a React
|
||||
// component with hooks returns null. See withastro/astro#12283.
|
||||
return <></>;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user