From 3cd4d01d7c9b97568f86446068b5398eaf6efd92 Mon Sep 17 00:00:00 2001 From: Zhe Zhang Date: Thu, 30 Jan 2020 21:32:53 +0800 Subject: [PATCH] Fixes #10333 `with-next-seo` sample issues (#10335) --- examples/with-next-seo/pages/_app.js | 32 ++++++++------------------ examples/with-next-seo/pages/index.js | 3 +-- examples/with-next-seo/pages/jsonld.js | 1 - 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/examples/with-next-seo/pages/_app.js b/examples/with-next-seo/pages/_app.js index d1412d86fa32585..e7be87169cb655c 100644 --- a/examples/with-next-seo/pages/_app.js +++ b/examples/with-next-seo/pages/_app.js @@ -3,30 +3,16 @@ * that will apply to every page. Full info on how the default works * can be found here: https://github.com/garmeeh/next-seo#default-seo-configuration */ -import App from 'next/app' -import React from 'react' -import NextSeo from 'next-seo' +import { DefaultSeo } from 'next-seo' import SEO from '../next-seo.config' -export default class MyApp extends App { - static async getInitialProps({ Component, ctx }) { - let pageProps = {} - if (Component.getInitialProps) { - pageProps = await Component.getInitialProps(ctx) - } - - return { pageProps } - } - - render() { - const { Component, pageProps } = this.props - return ( - /* Here we call NextSeo and pass our default configuration to it */ - <> - - - - ) - } +export default function MyApp({ Component, pageProps }) { + return ( + /* Here we call NextSeo and pass our default configuration to it */ + <> + + + + ) } diff --git a/examples/with-next-seo/pages/index.js b/examples/with-next-seo/pages/index.js index 70e4aaee8daa35a..e45a06b2550d86f 100644 --- a/examples/with-next-seo/pages/index.js +++ b/examples/with-next-seo/pages/index.js @@ -1,5 +1,4 @@ -import React from 'react' -import NextSeo from 'next-seo' +import { NextSeo } from 'next-seo' import Link from 'next/link' export default () => ( diff --git a/examples/with-next-seo/pages/jsonld.js b/examples/with-next-seo/pages/jsonld.js index ab9f8fda1b98224..3800a14e7453540 100644 --- a/examples/with-next-seo/pages/jsonld.js +++ b/examples/with-next-seo/pages/jsonld.js @@ -1,4 +1,3 @@ -import React from 'react' import { ArticleJsonLd } from 'next-seo' // See all available JSON-LD here: