Skip to content

Commit

Permalink
update docs for nextjs 10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
flybayer committed Apr 29, 2021
1 parent bf793f8 commit 5ed8f32
Show file tree
Hide file tree
Showing 11 changed files with 1,137 additions and 733 deletions.
2 changes: 1 addition & 1 deletion app/core/layouts/ContentsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export function ContentsLayout({children, meta, tableOfContents: toc}) {
<a
href={
"https://github.com/blitz-js/blitzjs.com/edit/main/app/pages" +
router.asPath +
router.asPath.split("#")[0] +
".mdx"
}
target="_blank"
Expand Down
4 changes: 3 additions & 1 deletion app/core/navs/documentation.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
},
"pages": [
"pages",
"redirects",
"error-pages",
"head-component",
"document-component",
Expand All @@ -73,6 +72,9 @@
"link",
"route-params-query",
"router",
"redirects",
"rewrites",
"headers",
"api-routes",
"shallow-routing",
"route-manifest"
Expand Down
15 changes: 14 additions & 1 deletion app/pages/docs/app-component.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,17 @@ props you send to `Component` will be received by the `page`.
`pageProps` is an object with the initial props that were preloaded for
your page by one of our data fetching methods like
[`getStaticProps`](./get-static-props) or
[`getServerSideProps`](./get-server-side-props)
[`getServerSideProps`](./get-server-side-props), otherwise it's an empty
object.

### Caveats {#caveats}

- Adding a custom `getInitialProps` in your `App` will disable
[Automatic Static Optimization](./pages#automatic-static-optimization)
in pages without [Static Generation](./get-static-props).
- When you add `getInitialProps` in your custom app, you must
`import App from "blitz"`, call `App.getInitialProps(appContext)` inside
`getInitialProps` and merge the returned object into the return value.
- `App` currently does not support page data fetching methods like
[`getStaticProps`](./get-static-props) or
[`getServerSideProps`](./get-server-side-props).
Loading

0 comments on commit 5ed8f32

Please sign in to comment.