forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const InfoBox = ({ children }) => ( | ||
<div className='info'> | ||
<style jsx>{` | ||
.info { | ||
margin-top: 20px; | ||
margin-bottom: 20px; | ||
padding-top: 20px; | ||
padding-bottom: 20px; | ||
border-top: 1px solid #ececec; | ||
border-bottom: 1px solid #ececec; | ||
} | ||
`}</style> | ||
{children} | ||
</div> | ||
) | ||
|
||
export default InfoBox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
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' | ||
> | ||
automatic static optimization | ||
</a> | ||
. | ||
</InfoBox> | ||
<Submit /> | ||
<PostList /> | ||
</App> | ||
) | ||
|
||
export default withApollo(ClientOnlyPage, { | ||
// Disable apollo ssr fetching in favor of automatic static optimization | ||
ssr: false | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters