Skip to content

Commit

Permalink
Fixes #10333 with-next-seo sample issues (#10335)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhe committed Jan 30, 2020
1 parent 9546011 commit 3cd4d01
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 26 deletions.
32 changes: 9 additions & 23 deletions examples/with-next-seo/pages/_app.js
Expand Up @@ -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 */
<>
<NextSeo config={SEO} />
<Component {...pageProps} />
</>
)
}
export default function MyApp({ Component, pageProps }) {
return (
/* Here we call NextSeo and pass our default configuration to it */
<>
<DefaultSeo {...SEO} />
<Component {...pageProps} />
</>
)
}
3 changes: 1 addition & 2 deletions 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 () => (
Expand Down
1 change: 0 additions & 1 deletion 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:
Expand Down

0 comments on commit 3cd4d01

Please sign in to comment.