Skip to content

Commit

Permalink
Updated docs (#10213)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Alvarez D committed Jan 22, 2020
1 parent dd4d3f7 commit f24aa41
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/api-reference/next.config.js/runtime-configuration.md
Expand Up @@ -28,7 +28,7 @@ Place any server-only runtime config under `serverRuntimeConfig`.

Anything accessible to both client and server-side code should be under `publicRuntimeConfig`.

> A page that relies on `publicRuntimeConfig` **must** use `getInitialProps` to opt-out of [Automatic Static Optimization](/docs/advanced-features/automatic-static-optimization.md).
> A page that relies on `publicRuntimeConfig` **must** use `getInitialProps` to opt-out of [Automatic Static Optimization](/docs/advanced-features/automatic-static-optimization.md). Runtime configuration won't be available to any page (or component in a page) without `getInitialProps`.
To get access to the runtime configs in your app use `next/config`, like so:

Expand Down
2 changes: 2 additions & 0 deletions docs/api-reference/next/link.md
Expand Up @@ -49,6 +49,8 @@ export default Home
- [`replace`](#replace-the-url-instead-of-push) - Replace the current `history` state instead of adding a new url into the stack. Defaults to `false`
- [`scroll`](#disable-scrolling-to-the-top-of-the-page) - Scroll to the top of the page after a navigation. Defaults to `true`

External URLs, and any links that don't require a route navigation using `/pages`, don't need to be handled with `Link`; use the anchor tag for such cases instead.

## Dynamic routes

A `Link` to a dynamic route is a combination of the `href` and `as` props. A link to the page `pages/post/[pid].js` will look like this:
Expand Down
2 changes: 2 additions & 0 deletions docs/api-routes/introduction.md
Expand Up @@ -46,6 +46,8 @@ export default (req, res) => {
}
```

To fetch API endpoints, take a look into any of the examples at the start of this section.

> API Routes [do not specify CORS headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), meaning they are **same-origin only** by default. You can customize such behavior by wrapping the request handler with [micro-cors](/docs/api-routes/api-middlewares.md#micro-support).
> API Routes do not increase your client-side bundle size. They are server-side only bundles.
Expand Down

0 comments on commit f24aa41

Please sign in to comment.