diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-02-21 19:34:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-21 19:34:01 +0100 |
| commit | 17842893306410f878eed66af5e807870e61cc49 (patch) | |
| tree | 57608ffb9374bb3bdbbe6b3c9903e6eaefa3c180 /src/components/Breadcrumb | |
| parent | f18fe8caa611e9273c5504fa81522e1ac93b95d2 (diff) | |
refactor: replace script tags with next/script (#10)
* refactor: replace script tags with next/script
Since next.js v12.1.0 some warnings was displayed because I was using
some script tags.
* build(deps): bump next-themes to v0.1.1
Diffstat (limited to 'src/components/Breadcrumb')
| -rw-r--r-- | src/components/Breadcrumb/Breadcrumb.tsx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/components/Breadcrumb/Breadcrumb.tsx b/src/components/Breadcrumb/Breadcrumb.tsx index 914a175..92350c0 100644 --- a/src/components/Breadcrumb/Breadcrumb.tsx +++ b/src/components/Breadcrumb/Breadcrumb.tsx @@ -1,7 +1,7 @@ import { settings } from '@utils/config'; -import Head from 'next/head'; import Link from 'next/link'; import { useRouter } from 'next/router'; +import Script from 'next/script'; import { useIntl } from 'react-intl'; import { BreadcrumbList, WithContext } from 'schema-dts'; import styles from './Breadcrumb.module.scss'; @@ -125,12 +125,11 @@ const Breadcrumb = ({ pageTitle }: { pageTitle: string }) => { return ( <> - <Head> - <script - type="application/ld+json" - dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaJsonLd) }} - ></script> - </Head> + <Script + id="schema-breadcrumb" + type="application/ld+json" + dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaJsonLd) }} + /> {!isHome && ( <nav id="breadcrumb" className={styles.wrapper}> <span className="screen-reader-text"> |
