I have the layout component imported in the _app.js file:
Layout.js:
const Layout = ({ children, webName, pageTitle }) => {
return (
<div>
<Head>
<meta charSet='utf-8' />
<meta
name='viewport'
content='width=device-width, initial-scale=1, shrink-to-fit=no'
/>
<meta name='description' content='' />
<meta name='author' content='Chris Achinga -> chrisdevcode.xyz' />
<title>Feet Of Colors Foundation</title>
</Head>
<PageHeader webName={webName} pageTitle={pageTitle} />
<NavBar webName={webName} />
<main>{children}</main>
<Footer />
</div>
)
}
export default Layout
The _app.js:
import Layout from '@/layout/Layout'
import '@/styles/globals.css'
export default function App({ Component, pageProps }) {
return (
<Layout>
<Component {...pageProps} />
</Layout>
)
}
I have different pages that I would love to pass different values to webName and pageTitle props, without using the Layout component in each file.
How do I achieve that?