Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #10333 with-next-seo sample issues #10335

Merged
merged 1 commit into from Jan 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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