Previously this would fail to typecheck if getInitialProps returned
props other than {}, because the splatting/spreading of the ...pageProps
when the props were assigned the type WithApolloOptions, meant that
the page props type parameter/generic was inferred a type of {}. This
shuffles stuff about so that things typecheck.
It also changes the const to a function, otherwise next js complains
that it doesn't have a name when hot reloading
Previously this would fail to typecheck if getInitialProps returned props other than {}, because the splatting/spreading of the ...pageProps when the props were assigned the type
WithApolloOptions
, meant that the page props type parameter/generic was inferred a type of {}. This shuffles stuff about so that things typecheck.It also changes the const to a function, otherwise next js complains that it doesn't have a name when hot reloading