1a50d99fbd
* Make withApollo work with _app.js components * Support wrapping functional _App * Add apolloClient to NextPageContext & NextPageContext * Propertly call App.getInitialProps if used in NextAppContext * Add Automatic Static Optimization warning * Update deps * Reduce API surface * Move back to singleton client * Improve documentation * Remove Head.rewind() We can get rid of .rewind by now as the latest next/head no longer uses legacy context. * Add extra docs * Reuse apolloState coming from previous hocs Co-authored-by: Joe Haddad <timer150@gmail.com>
29 lines
874 B
JavaScript
29 lines
874 B
JavaScript
import App from '../components/App'
|
||
import InfoBox from '../components/InfoBox'
|
||
import Header from '../components/Header'
|
||
import Submit from '../components/Submit'
|
||
import PostList from '../components/PostList'
|
||
import { withApollo } from '../lib/apollo'
|
||
|
||
const ClientOnlyPage = props => (
|
||
<App>
|
||
<Header />
|
||
<InfoBox>
|
||
ℹ️ This example shows how to disable apollos query fetching on the server.
|
||
If you <a href="/client-only">reload</a> this page, you will see a loader
|
||
since Apollo didn't fetch any data on the server. This allows{' '}
|
||
<a
|
||
href="https://nextjs.org/blog/next-9#automatic-static-optimization"
|
||
target="_blank"
|
||
rel="noopener noreferrer"
|
||
>
|
||
automatic static optimization
|
||
</a>
|
||
.
|
||
</InfoBox>
|
||
<Submit />
|
||
<PostList />
|
||
</App>
|
||
)
|
||
|
||
export default withApollo()(ClientOnlyPage)
|