A few HOCs are provided as utilities:
withApollo: Wraps a page into an
ApolloProviderand handles state rehydration between CSR navigation.
Can be used with any rendering mode (expect SSG by default).
Do not use
getInitialPropsby default, only when
useGetInitialProps: true(meant for pages using
withHOCTemplate: Template for quickly getting started with a new HOC, meant as a utility. Feel free to customise it!
This HOC is necessary for all pages in the demo, because all pages need data that are used by shared component (i.e: Nav, Footer).
If you don't need to fetch data from a data source, then you don't need to use it.
We don't actually use the
useGetInitialPropsoption anywhere in this demo, because we don't use