Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static async getInitialProps({ Component, ctx, router }) {
const store = getStore()
const pageProps =
(Component.getInitialProps &&
(await Component.getInitialProps({ ...ctx, store }))) ||
{}
let storeSnapshot
if (isServer) {
const tree =
await getDataFromTree(tree, store)
storeSnapshot = getSnapshot(store)
}
return { pageProps, storeSnapshot }
}