fix: log error message if <Head> rendering fails (#75)

This commit is contained in:
quenio-lt
2021-12-01 12:19:18 +01:00
committed by GitHub
parent 489da1b49d
commit c436705b96
+2 -1
View File
@@ -10,9 +10,10 @@ export function Head(props: HeadProps) {
let context: ComponentChildren[];
try {
context = useContext(HEAD_CONTEXT);
} catch {
} catch (err) {
throw new Error(
"<Head> component is not supported in the browser, or during suspense renders.",
{ cause: err },
);
}
context.push(props.children);