I have a custom _app.js:
const Layout = ({ children }) => (children);
const app = ({ Component, pageProps }) => {
pageProps.baseUrl = 'some url';
return (
<Layout>
<Component {...pageProps} />
</Layout>
)
};
And a page:
export async function getServerSideProps({ req, query, res, baseUrl }) {
// baseUrl is undefined and an error, if I am using it with destructiring
console.log(req) // There is no baseUrl
return { props: { ..... } }
}
I want to set that pageProps.baseUrl= 'some url'; in _app.js and use it in page components including getServerSideProps, how can I do that ?